Index: trunk/deploy.sh.in
===================================================================
--- trunk/deploy.sh.in	(revision 26)
+++ trunk/deploy.sh.in	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 26)
+++ trunk/docs/Changelog	(revision 27)
@@ -1,3 +1,8 @@
 2.2.0:
+	* 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
Index: trunk/docs/README.UPGRADE
===================================================================
--- trunk/docs/README.UPGRADE	(revision 26)
+++ trunk/docs/README.UPGRADE	(revision 27)
@@ -1,2 +1,12 @@
+
+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
 
Index: trunk/dsys/comBUILD
===================================================================
--- trunk/dsys/comBUILD	(revision 26)
+++ trunk/dsys/comBUILD	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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() {
Index: trunk/dsys/comCHECKSRC
===================================================================
--- trunk/dsys/comCHECKSRC	(revision 26)
+++ trunk/dsys/comCHECKSRC	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/comCLEAN	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/comDOWNLOAD	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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() {
Index: trunk/dsys/comINSTALL
===================================================================
--- trunk/dsys/comINSTALL	(revision 26)
+++ trunk/dsys/comINSTALL	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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() {
Index: trunk/dsys/comUNINSTALL
===================================================================
--- trunk/dsys/comUNINSTALL	(revision 26)
+++ trunk/dsys/comUNINSTALL	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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() {
Index: trunk/dsys/funcBUILD
===================================================================
--- trunk/dsys/funcBUILD	(revision 26)
+++ trunk/dsys/funcBUILD	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/funcDB	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/funcDIALOG	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/funcEXE	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/funcINSTALL	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 () {
Index: trunk/dsys/funcPRINT
===================================================================
--- trunk/dsys/funcPRINT	(revision 26)
+++ trunk/dsys/funcPRINT	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/funcSETUP	(revision 27)
@@ -4,4 +4,22 @@
 #
 #########################################################################
+#
+# 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 26)
+++ trunk/dsys/initscript	(revision 27)
@@ -1,3 +1,22 @@
 #! /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 26)
+++ trunk/dsys/postinstall	(revision 27)
@@ -1,3 +1,22 @@
 #! /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 26)
+++ trunk/dsys/preinstall	(revision 27)
@@ -1,3 +1,21 @@
 #! /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/include/samhain.h
===================================================================
--- trunk/include/samhain.h	(revision 26)
+++ trunk/include/samhain.h	(revision 27)
@@ -138,5 +138,8 @@
   SH_LEVEL_USER0       = 7,
   SH_LEVEL_USER1       = 8,
-  SH_LEVEL_PRELINK     = 9
+  SH_LEVEL_USER2       = 9,
+  SH_LEVEL_USER3       = 10,
+  SH_LEVEL_USER4       = 11,
+  SH_LEVEL_PRELINK     = 12
 };
 
Index: trunk/include/sh_error.h
===================================================================
--- trunk/include/sh_error.h	(revision 26)
+++ trunk/include/sh_error.h	(revision 27)
@@ -30,5 +30,5 @@
   SH_ERR_T_START  = 0,
 
-  /* 1-9 = SH_LEVEL_XXX */
+  /* 1-13 = SH_LEVEL_XXX */
 
   SH_ERR_T_RO      = SH_LEVEL_READONLY,
@@ -40,11 +40,14 @@
   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    = 10,
-  SH_ERR_T_FILE   = 11,
-  SH_ERR_T_NAME   = 12,
+  SH_ERR_T_DIR    = 13,
+  SH_ERR_T_FILE   = 14,
+  SH_ERR_T_NAME   = 15,
 
-  SH_ERR_T_END    = 13
+  SH_ERR_T_END    = 16
 };
 
Index: trunk/include/sh_files.h
===================================================================
--- trunk/include/sh_files.h	(revision 26)
+++ trunk/include/sh_files.h	(revision 27)
@@ -73,4 +73,16 @@
 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);
+
 /* push a directory on the stack PRELINK
  */
@@ -109,4 +121,16 @@
  */
 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);
 
 /* push a file on the stack PRELINK
@@ -155,4 +179,7 @@
 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);
Index: trunk/include/sh_forward.h
===================================================================
--- trunk/include/sh_forward.h	(revision 26)
+++ trunk/include/sh_forward.h	(revision 27)
@@ -41,4 +41,8 @@
  */
 int sh_forward_make_client (const char * str);
+
+/* set port to which we connect
+ */
+int sh_forward_server_port (const char * str);
 
 #ifdef SH_WITH_SERVER
@@ -91,9 +95,16 @@
 #endif
 
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 /* talk to server
  */
 long  sh_forward (char * errmsg);
 
+/* set log server
+ */
+int sh_forward_setlogserver (const char * address);
+void reset_count_dev_server(void);
+#endif
+
+#ifdef SH_WITH_CLIENT
 
 /* request file from server. file may be "CONF" or "DATA".
@@ -101,9 +112,4 @@
 long sh_forward_req_file (char * file);
 
-/* set log server
- */
-int sh_forward_setlogserver (const char * address);
-void reset_count_dev_server(void);
-
 #endif
 
Index: trunk/include/sh_tools.h
===================================================================
--- trunk/include/sh_tools.h	(revision 26)
+++ trunk/include/sh_tools.h	(revision 27)
@@ -53,5 +53,5 @@
 
 
-#if defined (SH_WITH_CLIENT)
+#if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 
 unsigned long write_port (int sockfd, char *buf, unsigned long nbytes, 
@@ -65,8 +65,9 @@
 		 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);
@@ -78,4 +79,9 @@
 #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_unix.h
===================================================================
--- trunk/include/sh_unix.h	(revision 26)
+++ trunk/include/sh_unix.h	(revision 27)
@@ -99,4 +99,7 @@
 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, abd with PREL)
  */
Index: trunk/man/samhain.8
===================================================================
--- trunk/man/samhain.8	(revision 26)
+++ trunk/man/samhain.8	(revision 27)
@@ -48,4 +48,7 @@
 .SS "MISCELLANEOUS"
 .PP
+
+.B samhain
+.RI \-\-server\-port= portnumber
 
 .B samhain
@@ -300,4 +303,9 @@
 .SS "MISCELLANEOUS OPTIONS"
 .PP
+
+.B samhain
+.RI \-\-server\-port= portnumber
+
+Choose the port on the server host to which the client will connect.
 
 .B samhain
Index: trunk/man/samhainrc.5
===================================================================
--- trunk/man/samhainrc.5	(revision 26)
+++ trunk/man/samhainrc.5	(revision 27)
@@ -96,4 +96,10 @@
 .TP
 .I "[User1]"
+.TP
+.I "[User2]"
+.TP
+.I "[User3]"
+.TP
+.I "[User4]"
 These are reserved for user-defined policies.
 .TP
@@ -172,7 +178,13 @@
 .br
 .BI  SeverityUser0= val,
+.br
+.BI  SeverityUser1= val,
+.br
+.BI  SeverityUser2= val,
+.br
+.BI  SeverityUser3= val,
 and
 .br
-.BI  SeverityUser1= val
+.BI  SeverityUser4= 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
@@ -514,4 +526,7 @@
 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). 
@@ -547,4 +562,13 @@
 .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/src/sh_database.c
===================================================================
--- trunk/src/sh_database.c	(revision 26)
+++ trunk/src/sh_database.c	(revision 27)
@@ -1192,38 +1192,5 @@
 	}
     }
-#if 0
-  /* apparently slower, see gyule.7 */
-  len = (long) strlen(val);
-
-  if ((val[0] != '\0') && (*size > 2))
-    {
-      if (flag == 1) 
-	{
-	  *end = ',';  ++end;
-	  *end = '\''; ++end; (*size) -= 2; 
-	  *end = '\0';
-	
-	  if ((long) *size > (len+2))
-	    {
-	      (void) sl_strlcat(end, val, (size_t) *size);
-	      end   += len; (*size) -= len;
-	      *end = '\''; ++end;  (*size) -= 1; 
-	    }
-	  *end = '\0'; 
-	}
-      else
-	{
-	  *end = ',';  ++end; (*size) -= 1;
-	  *end = '\0';
-	
-	  if ((long) *size > (len+1))
-	    {
-	      (void) sl_strlcat(end, val, (size_t) *size);
-	      end   += len; (*size) -= len;
-	    }
-	  *end = '\0';
-	}
-    }
-#endif
+
   return end;
 }
@@ -1695,13 +1662,46 @@
 }
 
+/* recursively enter linked list of messages into database, last first
+ */
+int sh_database_insert_rec (dbins * curr, unsigned int depth)
+{
+  long    id = 0;
+  dbins * prev;
+
+  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));
+    }
+
+  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"));
+}
+
 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"));
@@ -1714,35 +1714,10 @@
   (void) sh_database_parse (message, db_entry);
 
-  /* 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);
+  /* recursively enter the linked list into the database
+   */
+  (void) sh_database_insert_rec (db_entry, 0);
+
+  SL_RETURN(0, _("sh_database_insert"));
+}
+
 #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"));
-}
-
-#endif
Index: trunk/src/sh_error.c
===================================================================
--- trunk/src/sh_error.c	(revision 26)
+++ trunk/src/sh_error.c	(revision 27)
@@ -639,5 +639,5 @@
 }
 
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 /* set severity for TCP export
  */
@@ -843,5 +843,5 @@
 #endif
 
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
   char   * ex_msg;
 #endif
@@ -862,5 +862,5 @@
   static int syslog_block = 0;
   static int log_block    = 0;
-#if defined(SH_WITH_CLIENT)
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
   static int export_block = 0;
 #endif
@@ -926,4 +926,6 @@
     severity = sev;
 
+  /* these are messages from remote sources
+   */
   if ((severity  & SH_ERR_INET) != 0)
     {
@@ -939,5 +941,5 @@
        ( (errFlags.sysloglevel  & severity    ) == 0 || 
 	 (errFlags.syslog_class & (1 << class)) == 0 )     &&
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_CLIENT)
        ( (errFlags.exportlevel  & severity    ) == 0 ||
 	 (errFlags.export_class & (1 << class)) == 0 )     &&
@@ -958,5 +960,5 @@
 	 (errFlags.mail_class    & (1 << class)) == 0 )
 #ifdef SH_WITH_SERVER
-      && (flag_inet == S_FALSE)
+       && (flag_inet == S_FALSE) /* still log messages from remote sources */
 #endif
        )
@@ -1119,13 +1121,18 @@
        * to log server
        ****************************************************/
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
       /* Export by TCP.
        */
-      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 ( ((errFlags.exportlevel  & severity  )   != 0 &&
+	    (errFlags.export_class & (1 << class)) != 0 &&
+	    (errFlags.exportlevel  & SH_ERR_NOT)   == 0 &&
+	    class != AUD                               )
+#ifdef SH_WITH_SERVER
+	   || (flag_inet == S_TRUE) /* always log inet to export */
+#endif
+          /* sh.flag.isserver != GOOD                    && */
+          /* (flag_inet == S_FALSE) */ /* don't log inet to export */
+	   )
         {
           if (export_block == 0)
@@ -1142,5 +1149,4 @@
 	      sl_snprintf(ex_msg, ex_len, _("%d?%u?%s"),
 		      severity, class, lmsg->msg);
-
               retval = sh_forward (ex_msg);
 	      SH_FREE(ex_msg);
Index: trunk/src/sh_files.c
===================================================================
--- trunk/src/sh_files.c	(revision 26)
+++ trunk/src/sh_files.c	(revision 27)
@@ -454,8 +454,22 @@
 }
 
-
 int sh_files_pushfile_user1 (const 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));
 }
 
@@ -612,4 +626,16 @@
   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)
 {
@@ -657,4 +683,10 @@
     case SH_LEVEL_USER1:
       return (unsigned long) mask_USER1;
+    case SH_LEVEL_USER2:
+      return (unsigned long) mask_USER2;
+    case SH_LEVEL_USER3:
+      return (unsigned long) mask_USER3;
+    case SH_LEVEL_USER4:
+      return (unsigned long) mask_USER4;
     case SH_LEVEL_PRELINK:
       return (unsigned long) mask_PRELINK;
@@ -1042,4 +1074,19 @@
 {
   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));
 }
 
Index: trunk/src/sh_forward.c
===================================================================
--- trunk/src/sh_forward.c	(revision 26)
+++ trunk/src/sh_forward.c	(revision 27)
@@ -335,5 +335,5 @@
 #endif
 
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 
 static int count_dev_server = 0;
@@ -708,4 +708,21 @@
 static long sh_forward_try (char * errmsg);
 
+static unsigned int ServerPort = SH_DEFAULT_PORT;
+
+int sh_forward_server_port (const char * str)
+{
+  unsigned long l;
+  char * endptr;
+
+  SL_ENTER(_("sh_forward_server_port"));
+
+  l = strtoul (str, &endptr, 0);
+  if (l > 65535 || endptr == str)
+    {
+      SL_RETURN (-1, _("sh_forward_server_port"));
+    }
+  ServerPort = (unsigned int) l;
+  SL_RETURN (0, _("sh_forward_server_port"));
+}
 
 long sh_forward (char * errmsg)
@@ -880,5 +897,5 @@
 
   sockfd = connect_port_2 (sh.srvexport.name, sh.srvexport.alt, 
-			   SH_DEFAULT_PORT, 
+			   ServerPort, 
 			   error_call, &error_num, error_msg, 256);
 
@@ -1441,7 +1458,10 @@
 						flag_err,
 						MSG_TCP_NOCONF);
-			      } else {
+			      } 
+#ifdef SH_WITH_CLIENT
+			      else {
 				sh_socket_server_cmd(buffer);
 			      }
+#endif
 			      flag_err = 0;
 
Index: trunk/src/sh_getopt.c
===================================================================
--- trunk/src/sh_getopt.c	(revision 26)
+++ trunk/src/sh_getopt.c	(revision 27)
@@ -80,4 +80,11 @@
     sh_util_set_interactive },
 #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_forward_server_port },
+#endif
 #ifdef SH_WITH_SERVER
   { N_("server"),  
@@ -112,5 +119,5 @@
     HAS_ARG_YES, 
     sh_calls_set_bind_addr },
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT)
   { N_("set-export-severity"),  
     'e', 
@@ -554,5 +561,5 @@
 	  for (i = 0; op_table[i].longopt != NULL; ++i) 
 	    {
-      
+
 	      if (sl_strncmp(_(op_table[i].longopt), 
 			     &argv[1][2], 
@@ -562,5 +569,6 @@
 		  if ( op_table[i].hasArg == HAS_ARG_YES ) 
 		    {
-		      if ( (theequal = strchr(argv[1], '=')) == NULL) 
+		      theequal = strchr(argv[1], '=');
+		      if (theequal == NULL) 
 			{ 
 			  if (argc < 3) 
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 26)
+++ trunk/src/sh_hash.c	(revision 27)
@@ -297,4 +297,7 @@
     N_("[User0]"),
     N_("[User1]"),
+    N_("[User2]"),
+    N_("[User3]"),
+    N_("[User4]"),
     N_("[Prelink]"),
     NULL
Index: trunk/src/sh_readconf.c
===================================================================
--- trunk/src/sh_readconf.c	(revision 26)
+++ trunk/src/sh_readconf.c	(revision 27)
@@ -69,4 +69,7 @@
   SH_SECTION_USER0,
   SH_SECTION_USER1,
+  SH_SECTION_USER2,
+  SH_SECTION_USER3,
+  SH_SECTION_USER4,
   SH_SECTION_PRELINK,
 #if defined (SH_WITH_MAIL) 
@@ -108,4 +111,7 @@
   { 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
@@ -820,4 +826,16 @@
   { 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 },
@@ -892,4 +910,13 @@
   { 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, 
@@ -941,11 +968,16 @@
 #endif
 
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
   { 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_forward_setlogserver },
+#else
   { N_("setlogserver"),        SH_SECTION_CLT,  SH_SECTION_MISC, 
     sh_forward_setlogserver },
+#endif
 #endif
   { N_("setfilechecktime"),  SH_SECTION_MISC,   SH_SECTION_NONE, 
@@ -1088,4 +1120,7 @@
     N_("severityuser0"),
     N_("severityuser1"),
+    N_("severityuser2"),
+    N_("severityuser3"),
+    N_("severityuser4"),
     N_("severityprelink"),
     NULL
@@ -1104,4 +1139,7 @@
     SH_ERR_T_USER0,       
     SH_ERR_T_USER1,       
+    SH_ERR_T_USER2,       
+    SH_ERR_T_USER3,       
+    SH_ERR_T_USER4,       
     SH_ERR_T_PRELINK,       
   };
Index: trunk/src/sh_srp.c
===================================================================
--- trunk/src/sh_srp.c	(revision 26)
+++ trunk/src/sh_srp.c	(revision 27)
@@ -384,5 +384,5 @@
 }
 
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
   
 
@@ -489,5 +489,5 @@
   
   
-#ifdef SH_WITH_CLIENT
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
   
 char * sh_srp_S_c (char * u_str, char * B_str)
Index: trunk/src/sh_tools.c
===================================================================
--- trunk/src/sh_tools.c	(revision 26)
+++ trunk/src/sh_tools.c	(revision 27)
@@ -695,5 +695,5 @@
 }
 
-#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT)
+#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 static
 int sh_write_select(int type, int sockfd, 
@@ -842,5 +842,5 @@
 #endif
 
-#if defined (SH_WITH_CLIENT)
+#if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 unsigned long write_port (int sockfd, char *buf, unsigned long nbytes, 
 			  int * w_error, int timeout)
@@ -862,5 +862,5 @@
 #endif
 
-#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT)
+#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 
 unsigned long read_port (int sockfd, char *buf, unsigned long nbytes, 
@@ -898,5 +898,5 @@
 #endif
 
-#if defined (SH_WITH_CLIENT)
+#if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 
 int check_request (char * have, char * need)
@@ -952,5 +952,5 @@
 #endif
 
-#if defined (SH_WITH_CLIENT)
+#if defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER)
 
 void get_header (unsigned char * head, unsigned long * bytes, char * u)
@@ -1032,4 +1032,9 @@
  * (msg_size = payload_size - key_len = payload_size - 48)
  */ 
+
+/* 
+ * only SH_V2_FULLSIZE is used, and only once
+ */
+#if 0
 #ifdef SH_WITH_SERVER
 #define SH_V2_FULLSIZE  240
@@ -1041,4 +1046,6 @@
 #define SH_V2_MESSAGE   960
 #endif
+#endif
+#define SH_V2_FULLSIZE 1024
 
 #ifdef SH_ENCRYPT
@@ -1383,5 +1390,5 @@
 #endif
 
-#if defined (SH_WITH_CLIENT)
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 
 /* verify the checksum of a buffer; checksum comes first
@@ -1535,5 +1542,5 @@
 #endif
 
-#if defined(SH_WITH_CLIENT) || defined(SH_STEALTH) || defined(WITH_GPG) || defined(WITH_PGP)
+#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_GPG) || defined(WITH_PGP)
 
 /* --------- secure temporary file ------------ */
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 26)
+++ trunk/src/sh_unix.c	(revision 27)
@@ -127,4 +127,7 @@
 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_;
@@ -142,4 +145,7 @@
   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_;
Index: trunk/src/sh_userfiles.c
===================================================================
--- trunk/src/sh_userfiles.c	(revision 26)
+++ trunk/src/sh_userfiles.c	(revision 27)
@@ -221,4 +221,7 @@
     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            /* The default */          new->level = default_level;
@@ -332,4 +335,13 @@
                     (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);
Index: trunk/test/test.sh
===================================================================
--- trunk/test/test.sh	(revision 26)
+++ trunk/test/test.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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.
+#
 
 isok=`test -t 1 2>&1 | wc -c`
@@ -288,7 +307,8 @@
     rm -f testrc_1.dyn
     rm -f testrc_2
+    rm -f testrc_22
     rm -f ./.samhain_file
     rm -f ./.samhain_log*
-    rm -f ./.samhain_lock
+    rm -f ./.samhain_lock*
     test -d testrun_testdata && chmod -R 0700 testrun_testdata
     test -d .quarantine && rm -rf .quarantine
@@ -296,7 +316,8 @@
     rm -f test_log_db
     rm -f test_log_prelude
-    rm -f test_log_valgrind
+    rm -f test_log_valgrind*
     rm -f test_log_yulectl
     rm -f yule.html
+    rm -f yule.html2
 }
 
Index: trunk/test/testcompile.sh
===================================================================
--- trunk/test/testcompile.sh	(revision 26)
+++ trunk/test/testcompile.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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=56; export MAXTEST
Index: trunk/test/testext.sh
===================================================================
--- trunk/test/testext.sh	(revision 26)
+++ trunk/test/testext.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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=1; export MAXTEST
Index: trunk/test/testhash.sh
===================================================================
--- trunk/test/testhash.sh	(revision 26)
+++ trunk/test/testhash.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
Index: trunk/test/testrun_1.sh
===================================================================
--- trunk/test/testrun_1.sh	(revision 26)
+++ trunk/test/testrun_1.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
Index: trunk/test/testrun_1a.sh
===================================================================
--- trunk/test/testrun_1a.sh	(revision 26)
+++ trunk/test/testrun_1a.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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-micro-stealth=137 --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"
Index: trunk/test/testrun_1b.sh
===================================================================
--- trunk/test/testrun_1b.sh	(revision 26)
+++ trunk/test/testrun_1b.sh	(revision 27)
@@ -1,4 +1,22 @@
 #! /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
Index: trunk/test/testrun_1c.sh
===================================================================
--- trunk/test/testrun_1c.sh	(revision 26)
+++ trunk/test/testrun_1c.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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"
Index: trunk/test/testrun_2.sh
===================================================================
--- trunk/test/testrun_2.sh	(revision 26)
+++ trunk/test/testrun_2.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
@@ -16,5 +35,16 @@
 	rm -f test_log_valgrind
 
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
+	${VALGRIND} ./yule.2 -l info -p none >/dev/null 2>>test_log_valgrind &
+	PROC_Y2=$!
+	sleep 5
+
+	[ -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=$!
 	sleep 5
@@ -32,9 +62,36 @@
 	    [ -z "$quiet" ]   && log_msg_fail  "samhain.new -t check";
 	    kill $PROC_Y
+	    kill $PROC_Y2
 	    return 1
 	fi
 
 	kill $PROC_Y
-	sleep 5
+	kill $PROC_Y2
+	sleep 5
+
+	# 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
@@ -195,5 +252,5 @@
 	rm -f test_log_valgrind
 
-	${VALGRIND} ./yule -p none >/dev/null 2>>test_log_valgrind &
+	${VALGRIND} ./yule -p none -e none >/dev/null 2>>test_log_valgrind &
 	PROC_Y=$!
 	sleep 5
@@ -292,5 +349,6 @@
 	rm -f test_log_valgrind
 
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
+	${VALGRIND} ./yule -l info -p none -e none \
+	    >/dev/null 2>>test_log_valgrind &
 	PROC_Y=$!
 	sleep 5
@@ -427,21 +485,22 @@
 ) >entry.html
 
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
+	${VALGRIND} ./yule -l info -p none -e none \
+	    >/dev/null 2>>test_log_valgrind &
 	PROC_Y=$!
 	sleep 5
 
 	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 "head.html";
-	    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";
+	    [ -z "$verbose" ] || log_msg_fail "foot.html (1)";
 	    return 1
 	fi
@@ -500,5 +559,5 @@
 	egrep '<!-- ehead -->' $HTML >/dev/null 2>&1
 	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "head.html";
+	    [ -z "$verbose" ] || log_msg_fail "end head.html";
 	    return 1
 	fi
@@ -511,5 +570,5 @@
 	egrep '<!-- eentry -->' $HTML >/dev/null 2>&1
 	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "entry.html";
+	    [ -z "$verbose" ] || log_msg_fail "end entry.html";
 	    return 1
 	fi
@@ -522,5 +581,5 @@
 	egrep '<!-- efoot -->' $HTML >/dev/null 2>&1
 	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "foot.html";
+	    [ -z "$verbose" ] || log_msg_fail "end foot.html";
 	    return 1
 	fi
@@ -571,10 +630,10 @@
 	fi
 
-	# save binary and build server
+	# 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  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --with-html-file=$HTML --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=${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
@@ -593,4 +652,26 @@
 	fi
 
+	# save binary and build server
+	#
+	cp yule yule.2 || 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  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-html-file=$HTML --with-state-dir=$PW_DIR --enable-encrypt=2
+	#
+	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
+
 
 	#####################################################################
@@ -633,6 +714,21 @@
 	mv samhain.build.new  samhain.new || return 1
 
-	rm -f ./.samhain_log.*
-	rm -f ./.samhain_lock
+	# 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 | sed s%HOSTNAME%${SH_LOCALHOST}%`
@@ -646,4 +742,5 @@
 
  	echo $SHCLT >> testrc_2
+	cp testrc_2 testrc_22
 
 	do_test_1
Index: trunk/test/testrun_2a.sh
===================================================================
--- trunk/test/testrun_2a.sh	(revision 26)
+++ trunk/test/testrun_2a.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
Index: trunk/test/testrun_2b.sh
===================================================================
--- trunk/test/testrun_2b.sh	(revision 26)
+++ trunk/test/testrun_2b.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
Index: trunk/test/testrun_2c.sh
===================================================================
--- trunk/test/testrun_2c.sh	(revision 26)
+++ trunk/test/testrun_2c.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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=mysql"; export SERVER_BUILDOPTS
Index: trunk/test/testrun_2d.sh
===================================================================
--- trunk/test/testrun_2d.sh	(revision 26)
+++ trunk/test/testrun_2d.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
Index: trunk/test/testtimesrv.sh
===================================================================
--- trunk/test/testtimesrv.sh	(revision 26)
+++ trunk/test/testtimesrv.sh	(revision 27)
@@ -1,3 +1,22 @@
 #! /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
