Changeset 27
- Timestamp:
- Apr 6, 2006, 8:55:51 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 53 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/deploy.sh.in
r1 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2005) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 #VERSION2.0 -
trunk/docs/Changelog
r25 r27 1 1 2.2.0: 2 * add copyright/license info to test scripts 3 * add copyright/license info to deployment system scripts 4 * support server-to-server relay 5 * new CL option --server-port 6 * minor improvements in manual 2 7 * patch by Yoann Vandoorselaere for sh_prelude.c 3 8 * allow --longopt arg as well as --longopt=arg -
trunk/docs/README.UPGRADE
r18 r27 1 2 since 2.2.0: server-to-server relay is possible 3 4 -- this implies that problems will arise if your server is misconfigured 5 to connect to itself (SetExportSeverity is explicitely set 6 to a threshold different from 'none', and the logserver is set to 7 localhost). The server may deadlock in this case. 8 9 10 1 11 since 2.1.0: update and daemon mode can be combined 2 12 -
trunk/dsys/comBUILD
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 commandBUILD() { -
trunk/dsys/comCHECKSRC
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 commandCHECKSRC() { -
trunk/dsys/comCLEAN
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 commandCLEAN() { -
trunk/dsys/comDOWNLOAD
r25 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 commandDOWNLOAD() { -
trunk/dsys/comINSTALL
r3 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 commandINSTALL() { -
trunk/dsys/comUNINSTALL
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 commandUNINSTALL() { -
trunk/dsys/funcBUILD
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 #------------------------------------------------------------------------ -
trunk/dsys/funcDB
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 DBFTEST=0 -
trunk/dsys/funcDIALOG
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 # print without newline -
trunk/dsys/funcEXE
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 findEXE() { -
trunk/dsys/funcINSTALL
r4 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 getconfopts () { -
trunk/dsys/funcPRINT
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 # Fatal error -
trunk/dsys/funcSETUP
r1 r27 4 4 # 5 5 ######################################################################### 6 # 7 # Copyright Rainer Wichmann (2005) 8 # 9 # License Information: 10 # This program is free software; you can redistribute it and/or modify 11 # it under the terms of the GNU General Public License as published by 12 # the Free Software Foundation; either version 2 of the License, or 13 # (at your option) any later version. 14 # 15 # This program is distributed in the hope that it will be useful, 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 # GNU General Public License for more details. 19 # 20 # You should have received a copy of the GNU General Public License 21 # along with this program; if not, write to the Free Software 22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 # 6 24 7 25 # test setup -
trunk/dsys/initscript
r1 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2005) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 startup=no -
trunk/dsys/postinstall
r1 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2005) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 name=`./samhain-install.sh --print-config name` -
trunk/dsys/preinstall
r1 r27 1 1 #! /bin/sh 2 # 3 # Copyright Rainer Wichmann (2005) 4 # 5 # License Information: 6 # This program is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; either version 2 of the License, or 9 # (at your option) any later version. 10 # 11 # This program is distributed in the hope that it will be useful, 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 # GNU General Public License for more details. 15 # 16 # You should have received a copy of the GNU General Public License 17 # along with this program; if not, write to the Free Software 18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 # 2 20 3 21 name=`./samhain-install.sh --print-config name` -
trunk/include/samhain.h
r25 r27 138 138 SH_LEVEL_USER0 = 7, 139 139 SH_LEVEL_USER1 = 8, 140 SH_LEVEL_PRELINK = 9 140 SH_LEVEL_USER2 = 9, 141 SH_LEVEL_USER3 = 10, 142 SH_LEVEL_USER4 = 11, 143 SH_LEVEL_PRELINK = 12 141 144 }; 142 145 -
trunk/include/sh_error.h
r22 r27 30 30 SH_ERR_T_START = 0, 31 31 32 /* 1- 9= SH_LEVEL_XXX */32 /* 1-13 = SH_LEVEL_XXX */ 33 33 34 34 SH_ERR_T_RO = SH_LEVEL_READONLY, … … 40 40 SH_ERR_T_USER0 = SH_LEVEL_USER0, 41 41 SH_ERR_T_USER1 = SH_LEVEL_USER1, 42 SH_ERR_T_USER2 = SH_LEVEL_USER2, 43 SH_ERR_T_USER3 = SH_LEVEL_USER3, 44 SH_ERR_T_USER4 = SH_LEVEL_USER4, 42 45 SH_ERR_T_PRELINK = SH_LEVEL_PRELINK, 43 46 44 SH_ERR_T_DIR = 1 0,45 SH_ERR_T_FILE = 1 1,46 SH_ERR_T_NAME = 1 2,47 SH_ERR_T_DIR = 13, 48 SH_ERR_T_FILE = 14, 49 SH_ERR_T_NAME = 15, 47 50 48 SH_ERR_T_END = 1 351 SH_ERR_T_END = 16 49 52 }; 50 53 -
trunk/include/sh_files.h
r22 r27 73 73 int sh_files_pushdir_user1 (const char * dirName); 74 74 75 /* push a directory on the stack USER2 76 */ 77 int sh_files_pushdir_user2 (const char * dirName); 78 79 /* push a directory on the stack USER3 80 */ 81 int sh_files_pushdir_user3 (const char * dirName); 82 83 /* push a directory on the stack USER4 84 */ 85 int sh_files_pushdir_user4 (const char * dirName); 86 75 87 /* push a directory on the stack PRELINK 76 88 */ … … 109 121 */ 110 122 int sh_files_pushfile_user1 (const char * dirName); 123 124 /* push a file on the stack USER2 125 */ 126 int sh_files_pushfile_user2 (const char * dirName); 127 128 /* push a file on the stack USER3 129 */ 130 int sh_files_pushfile_user3 (const char * dirName); 131 132 /* push a file on the stack USER4 133 */ 134 int sh_files_pushfile_user4 (const char * dirName); 111 135 112 136 /* push a file on the stack PRELINK … … 155 179 int sh_files_redef_user0(const char * str); 156 180 int sh_files_redef_user1(const char * str); 181 int sh_files_redef_user2(const char * str); 182 int sh_files_redef_user3(const char * str); 183 int sh_files_redef_user4(const char * str); 157 184 int sh_files_redef_prelink(const char * str); 158 185 int sh_files_redef_readonly(const char * str); -
trunk/include/sh_forward.h
r22 r27 41 41 */ 42 42 int sh_forward_make_client (const char * str); 43 44 /* set port to which we connect 45 */ 46 int sh_forward_server_port (const char * str); 43 47 44 48 #ifdef SH_WITH_SERVER … … 91 95 #endif 92 96 93 #if def SH_WITH_CLIENT97 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 94 98 /* talk to server 95 99 */ 96 100 long sh_forward (char * errmsg); 97 101 102 /* set log server 103 */ 104 int sh_forward_setlogserver (const char * address); 105 void reset_count_dev_server(void); 106 #endif 107 108 #ifdef SH_WITH_CLIENT 98 109 99 110 /* request file from server. file may be "CONF" or "DATA". … … 101 112 long sh_forward_req_file (char * file); 102 113 103 /* set log server104 */105 int sh_forward_setlogserver (const char * address);106 void reset_count_dev_server(void);107 108 114 #endif 109 115 -
trunk/include/sh_tools.h
r1 r27 53 53 54 54 55 #if defined (SH_WITH_CLIENT) 55 #if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 56 56 57 57 unsigned long write_port (int sockfd, char *buf, unsigned long nbytes, … … 65 65 unsigned long * length, char * u); 66 66 67 68 SL_TICKET open_tmp (void); 69 int close_tmp (SL_TICKET fd); 70 int rewind_tmp (SL_TICKET fd); 67 /* 68 SL_TICKET open_tmp (void); 69 int close_tmp (SL_TICKET fd); 70 int rewind_tmp (SL_TICKET fd); 71 */ 71 72 72 73 void sh_tools_server_cmd(const char * srvcmd); … … 78 79 #endif 79 80 81 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_GPG) || defined(WITH_PGP) 82 SL_TICKET open_tmp (void); 83 int close_tmp (SL_TICKET fd); 84 int rewind_tmp (SL_TICKET fd); 85 #endif 80 86 81 87 #endif -
trunk/include/sh_unix.h
r25 r27 99 99 extern unsigned long mask_USER0; 100 100 extern unsigned long mask_USER1; 101 extern unsigned long mask_USER2; 102 extern unsigned long mask_USER3; 103 extern unsigned long mask_USER4; 101 104 /* like READONLY, but without MTM,CTM,SIZ,INO, abd with PREL) 102 105 */ -
trunk/man/samhain.8
r3 r27 48 48 .SS "MISCELLANEOUS" 49 49 .PP 50 51 .B samhain 52 .RI \-\-server\-port= portnumber 50 53 51 54 .B samhain … … 300 303 .SS "MISCELLANEOUS OPTIONS" 301 304 .PP 305 306 .B samhain 307 .RI \-\-server\-port= portnumber 308 309 Choose the port on the server host to which the client will connect. 302 310 303 311 .B samhain -
trunk/man/samhainrc.5
r1 r27 96 96 .TP 97 97 .I "[User1]" 98 .TP 99 .I "[User2]" 100 .TP 101 .I "[User3]" 102 .TP 103 .I "[User4]" 98 104 These are reserved for user-defined policies. 99 105 .TP … … 172 178 .br 173 179 .BI SeverityUser0= val, 180 .br 181 .BI SeverityUser1= val, 182 .br 183 .BI SeverityUser2= val, 184 .br 185 .BI SeverityUser3= val, 174 186 and 175 187 .br 176 .BI SeverityUser 1= val188 .BI SeverityUser4= val 177 189 define the error levels for failures to verify the integrity of 178 190 files/directories of the respective types. I.e. if such a file shows … … 514 526 sets the hostname for the log server. 515 527 .br 528 .BI SetServerPort= portnumber 529 sets the port on the server to connect to. 530 .br 516 531 .BI SetDatabasePath= AUTO|/path 517 532 Path to database (AUTO to tack hostname on compiled-in path). … … 547 562 .BI RedefUser1= +/-XXX,+/-YYY,... 548 563 Add or subtract tests XXX from the User1 policy. 564 .br 565 .BI RedefUser2= +/-XXX,+/-YYY,... 566 Add or subtract tests XXX from the User2 policy. 567 .br 568 .BI RedefUser3= +/-XXX,+/-YYY,... 569 Add or subtract tests XXX from the User3 policy. 570 .br 571 .BI RedefUser4= +/-XXX,+/-YYY,... 572 Add or subtract tests XXX from the User4 policy. 549 573 .TP 550 574 .B Server Only -
trunk/src/sh_database.c
r22 r27 1192 1192 } 1193 1193 } 1194 #if 0 1195 /* apparently slower, see gyule.7 */ 1196 len = (long) strlen(val); 1197 1198 if ((val[0] != '\0') && (*size > 2)) 1199 { 1200 if (flag == 1) 1201 { 1202 *end = ','; ++end; 1203 *end = '\''; ++end; (*size) -= 2; 1204 *end = '\0'; 1205 1206 if ((long) *size > (len+2)) 1207 { 1208 (void) sl_strlcat(end, val, (size_t) *size); 1209 end += len; (*size) -= len; 1210 *end = '\''; ++end; (*size) -= 1; 1211 } 1212 *end = '\0'; 1213 } 1214 else 1215 { 1216 *end = ','; ++end; (*size) -= 1; 1217 *end = '\0'; 1218 1219 if ((long) *size > (len+1)) 1220 { 1221 (void) sl_strlcat(end, val, (size_t) *size); 1222 end += len; (*size) -= len; 1223 } 1224 *end = '\0'; 1225 } 1226 } 1227 #endif 1194 1228 1195 return end; 1229 1196 } … … 1695 1662 } 1696 1663 1664 /* recursively enter linked list of messages into database, last first 1665 */ 1666 int sh_database_insert_rec (dbins * curr, unsigned int depth) 1667 { 1668 long id = 0; 1669 dbins * prev; 1670 1671 SL_ENTER(_("sh_database_insert_rec")); 1672 1673 if (curr->next) 1674 { 1675 prev = curr->next; 1676 sl_strlcpy(prev->host, curr->host, 64); 1677 id = sh_database_insert_rec (curr->next, (depth + 1)); 1678 } 1679 1680 if (id != 0) /* this is a server wrapper */ 1681 { 1682 if (enter_wrapper != 0) 1683 { 1684 id = sh_database_entry (curr, id); 1685 } 1686 } 1687 else 1688 { 1689 /* 1690 * id = -1 is the client message; log_ref will be NULL 1691 */ 1692 if (depth > 0) /* this is a client message */ 1693 id = sh_database_entry (curr, -1); 1694 else /* this is a generic server message */ 1695 id = sh_database_entry (curr, 0); 1696 } 1697 1698 SH_FREE(curr); 1699 1700 SL_RETURN(id, _("sh_database_insert")); 1701 } 1702 1697 1703 int sh_database_insert (char * message) 1698 1704 { 1699 1705 dbins * db_entry; 1700 dbins * prev;1701 dbins * curr;1702 long id = 0;1703 #ifdef HOST_SWITCH1704 char * temp[64];1705 #endif1706 1706 1707 1707 SL_ENTER(_("sh_database_insert")); … … 1714 1714 (void) sh_database_parse (message, db_entry); 1715 1715 1716 /* Enter the list into the database. Actually, the list can only have 1717 * two entries at most. 1718 */ 1719 curr = db_entry; 1720 if (curr->next) 1721 { 1722 prev = curr->next; 1723 #ifdef HOST_SWITCH 1724 strncpy(temp, prev->host, 64); 1716 /* recursively enter the linked list into the database 1717 */ 1718 (void) sh_database_insert_rec (db_entry, 0); 1719 1720 SL_RETURN(0, _("sh_database_insert")); 1721 } 1722 1725 1723 #endif 1726 strncpy(prev->host, curr->host, 64);1727 #ifdef HOST_SWITCH1728 strncpy(curr->host, temp, 64);1729 #endif1730 id = sh_database_entry (prev, -1);1731 SH_FREE(prev);1732 }1733 1734 if (id != 0) /* this is a server wrapper */1735 {1736 if (enter_wrapper != 0)1737 (void) sh_database_entry (curr, id);1738 }1739 else /* this is a generic server message */1740 {1741 (void) sh_database_entry (curr, 0);1742 }1743 SH_FREE(curr);1744 1745 SL_RETURN(0, _("sh_database_insert"));1746 }1747 1748 #endif -
trunk/src/sh_error.c
r22 r27 639 639 } 640 640 641 #if def SH_WITH_CLIENT641 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 642 642 /* set severity for TCP export 643 643 */ … … 843 843 #endif 844 844 845 #if def SH_WITH_CLIENT845 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 846 846 char * ex_msg; 847 847 #endif … … 862 862 static int syslog_block = 0; 863 863 static int log_block = 0; 864 #if defined(SH_WITH_CLIENT) 864 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 865 865 static int export_block = 0; 866 866 #endif … … 926 926 severity = sev; 927 927 928 /* these are messages from remote sources 929 */ 928 930 if ((severity & SH_ERR_INET) != 0) 929 931 { … … 939 941 ( (errFlags.sysloglevel & severity ) == 0 || 940 942 (errFlags.syslog_class & (1 << class)) == 0 ) && 941 #if def SH_WITH_CLIENT943 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_CLIENT) 942 944 ( (errFlags.exportlevel & severity ) == 0 || 943 945 (errFlags.export_class & (1 << class)) == 0 ) && … … 958 960 (errFlags.mail_class & (1 << class)) == 0 ) 959 961 #ifdef SH_WITH_SERVER 960 && (flag_inet == S_FALSE)962 && (flag_inet == S_FALSE) /* still log messages from remote sources */ 961 963 #endif 962 964 ) … … 1119 1121 * to log server 1120 1122 ****************************************************/ 1121 #if def SH_WITH_CLIENT1123 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 1122 1124 /* Export by TCP. 1123 1125 */ 1124 if ((errFlags.exportlevel & severity ) != 0 && 1125 (errFlags.export_class & (1 << class)) != 0 && 1126 (errFlags.exportlevel & SH_ERR_NOT) == 0 && 1127 class != AUD && 1128 sh.flag.isserver != GOOD && 1129 (flag_inet == S_FALSE) ) /* don't log inet to export */ 1126 1127 if ( ((errFlags.exportlevel & severity ) != 0 && 1128 (errFlags.export_class & (1 << class)) != 0 && 1129 (errFlags.exportlevel & SH_ERR_NOT) == 0 && 1130 class != AUD ) 1131 #ifdef SH_WITH_SERVER 1132 || (flag_inet == S_TRUE) /* always log inet to export */ 1133 #endif 1134 /* sh.flag.isserver != GOOD && */ 1135 /* (flag_inet == S_FALSE) */ /* don't log inet to export */ 1136 ) 1130 1137 { 1131 1138 if (export_block == 0) … … 1142 1149 sl_snprintf(ex_msg, ex_len, _("%d?%u?%s"), 1143 1150 severity, class, lmsg->msg); 1144 1145 1151 retval = sh_forward (ex_msg); 1146 1152 SH_FREE(ex_msg); -
trunk/src/sh_files.c
r22 r27 454 454 } 455 455 456 457 456 int sh_files_pushfile_user1 (const char * str_s) 458 457 { 459 458 return (sh_files_pushfile (SH_LEVEL_USER1, str_s)); 459 } 460 461 int sh_files_pushfile_user2 (const char * str_s) 462 { 463 return (sh_files_pushfile (SH_LEVEL_USER2, str_s)); 464 } 465 466 int sh_files_pushfile_user3 (const char * str_s) 467 { 468 return (sh_files_pushfile (SH_LEVEL_USER3, str_s)); 469 } 470 471 int sh_files_pushfile_user4 (const char * str_s) 472 { 473 return (sh_files_pushfile (SH_LEVEL_USER4, str_s)); 460 474 } 461 475 … … 612 626 return (sh_files_parse_mask(&mask_USER1, str)); 613 627 } 628 int sh_files_redef_user2(const char * str) 629 { 630 return (sh_files_parse_mask(&mask_USER2, str)); 631 } 632 int sh_files_redef_user3(const char * str) 633 { 634 return (sh_files_parse_mask(&mask_USER3, str)); 635 } 636 int sh_files_redef_user4(const char * str) 637 { 638 return (sh_files_parse_mask(&mask_USER4, str)); 639 } 614 640 int sh_files_redef_readonly(const char * str) 615 641 { … … 657 683 case SH_LEVEL_USER1: 658 684 return (unsigned long) mask_USER1; 685 case SH_LEVEL_USER2: 686 return (unsigned long) mask_USER2; 687 case SH_LEVEL_USER3: 688 return (unsigned long) mask_USER3; 689 case SH_LEVEL_USER4: 690 return (unsigned long) mask_USER4; 659 691 case SH_LEVEL_PRELINK: 660 692 return (unsigned long) mask_PRELINK; … … 1042 1074 { 1043 1075 return (sh_files_pushdir (SH_LEVEL_USER1, str_s)); 1076 } 1077 1078 int sh_files_pushdir_user2 (const char * str_s) 1079 { 1080 return (sh_files_pushdir (SH_LEVEL_USER2, str_s)); 1081 } 1082 1083 int sh_files_pushdir_user3 (const char * str_s) 1084 { 1085 return (sh_files_pushdir (SH_LEVEL_USER3, str_s)); 1086 } 1087 1088 int sh_files_pushdir_user4 (const char * str_s) 1089 { 1090 return (sh_files_pushdir (SH_LEVEL_USER4, str_s)); 1044 1091 } 1045 1092 -
trunk/src/sh_forward.c
r22 r27 335 335 #endif 336 336 337 #if def SH_WITH_CLIENT337 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 338 338 339 339 static int count_dev_server = 0; … … 708 708 static long sh_forward_try (char * errmsg); 709 709 710 static unsigned int ServerPort = SH_DEFAULT_PORT; 711 712 int sh_forward_server_port (const char * str) 713 { 714 unsigned long l; 715 char * endptr; 716 717 SL_ENTER(_("sh_forward_server_port")); 718 719 l = strtoul (str, &endptr, 0); 720 if (l > 65535 || endptr == str) 721 { 722 SL_RETURN (-1, _("sh_forward_server_port")); 723 } 724 ServerPort = (unsigned int) l; 725 SL_RETURN (0, _("sh_forward_server_port")); 726 } 710 727 711 728 long sh_forward (char * errmsg) … … 880 897 881 898 sockfd = connect_port_2 (sh.srvexport.name, sh.srvexport.alt, 882 S H_DEFAULT_PORT,899 ServerPort, 883 900 error_call, &error_num, error_msg, 256); 884 901 … … 1441 1458 flag_err, 1442 1459 MSG_TCP_NOCONF); 1443 } else { 1460 } 1461 #ifdef SH_WITH_CLIENT 1462 else { 1444 1463 sh_socket_server_cmd(buffer); 1445 1464 } 1465 #endif 1446 1466 flag_err = 0; 1447 1467 -
trunk/src/sh_getopt.c
r22 r27 80 80 sh_util_set_interactive }, 81 81 #endif 82 #if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT) 83 { N_("server-port"), 84 '-', 85 N_("Set the server port to connect to"), 86 HAS_ARG_YES, 87 sh_forward_server_port }, 88 #endif 82 89 #ifdef SH_WITH_SERVER 83 90 { N_("server"), … … 112 119 HAS_ARG_YES, 113 120 sh_calls_set_bind_addr }, 114 #if def SH_WITH_CLIENT121 #if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT) 115 122 { N_("set-export-severity"), 116 123 'e', … … 554 561 for (i = 0; op_table[i].longopt != NULL; ++i) 555 562 { 556 563 557 564 if (sl_strncmp(_(op_table[i].longopt), 558 565 &argv[1][2], … … 562 569 if ( op_table[i].hasArg == HAS_ARG_YES ) 563 570 { 564 if ( (theequal = strchr(argv[1], '=')) == NULL) 571 theequal = strchr(argv[1], '='); 572 if (theequal == NULL) 565 573 { 566 574 if (argc < 3) -
trunk/src/sh_hash.c
r22 r27 297 297 N_("[User0]"), 298 298 N_("[User1]"), 299 N_("[User2]"), 300 N_("[User3]"), 301 N_("[User4]"), 299 302 N_("[Prelink]"), 300 303 NULL -
trunk/src/sh_readconf.c
r22 r27 69 69 SH_SECTION_USER0, 70 70 SH_SECTION_USER1, 71 SH_SECTION_USER2, 72 SH_SECTION_USER3, 73 SH_SECTION_USER4, 71 74 SH_SECTION_PRELINK, 72 75 #if defined (SH_WITH_MAIL) … … 108 111 { N_("[User0]"), SH_SECTION_USER0}, 109 112 { N_("[User1]"), SH_SECTION_USER1}, 113 { N_("[User2]"), SH_SECTION_USER2}, 114 { N_("[User3]"), SH_SECTION_USER3}, 115 { N_("[User4]"), SH_SECTION_USER4}, 110 116 { N_("[Prelink]"), SH_SECTION_PRELINK}, 111 117 #ifdef WITH_EXTERNAL … … 820 826 { N_("file"), SH_SECTION_USER1, SH_SECTION_NONE, 821 827 sh_files_pushfile_user1 }, 828 { N_("dir"), SH_SECTION_USER2, SH_SECTION_NONE, 829 sh_files_pushdir_user2 }, 830 { N_("file"), SH_SECTION_USER2, SH_SECTION_NONE, 831 sh_files_pushfile_user2 }, 832 { N_("dir"), SH_SECTION_USER3, SH_SECTION_NONE, 833 sh_files_pushdir_user3 }, 834 { N_("file"), SH_SECTION_USER3, SH_SECTION_NONE, 835 sh_files_pushfile_user3 }, 836 { N_("dir"), SH_SECTION_USER4, SH_SECTION_NONE, 837 sh_files_pushdir_user4 }, 838 { N_("file"), SH_SECTION_USER4, SH_SECTION_NONE, 839 sh_files_pushfile_user4 }, 822 840 { N_("dir"), SH_SECTION_PRELINK, SH_SECTION_NONE, 823 841 sh_files_pushdir_prelink }, … … 892 910 { N_("redefuser1"), SH_SECTION_MISC, SH_SECTION_NONE, 893 911 sh_files_redef_user1 }, 912 913 { N_("redefuser2"), SH_SECTION_MISC, SH_SECTION_NONE, 914 sh_files_redef_user2 }, 915 916 { N_("redefuser3"), SH_SECTION_MISC, SH_SECTION_NONE, 917 sh_files_redef_user3 }, 918 919 { N_("redefuser4"), SH_SECTION_MISC, SH_SECTION_NONE, 920 sh_files_redef_user4 }, 894 921 895 922 { N_("redefprelink"), SH_SECTION_MISC, SH_SECTION_NONE, … … 941 968 #endif 942 969 943 #if def SH_WITH_CLIENT970 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 944 971 { N_("exportseverity"), SH_SECTION_LOG, SH_SECTION_NONE, 945 972 sh_error_setexport }, 946 973 { N_("exportclass"), SH_SECTION_LOG, SH_SECTION_NONE, 947 974 sh_error_export_mask }, 975 #if defined(SH_WITH_SERVER) 976 { N_("setlogserver"), SH_SECTION_SRV, SH_SECTION_MISC, 977 sh_forward_setlogserver }, 978 #else 948 979 { N_("setlogserver"), SH_SECTION_CLT, SH_SECTION_MISC, 949 980 sh_forward_setlogserver }, 981 #endif 950 982 #endif 951 983 { N_("setfilechecktime"), SH_SECTION_MISC, SH_SECTION_NONE, … … 1088 1120 N_("severityuser0"), 1089 1121 N_("severityuser1"), 1122 N_("severityuser2"), 1123 N_("severityuser3"), 1124 N_("severityuser4"), 1090 1125 N_("severityprelink"), 1091 1126 NULL … … 1104 1139 SH_ERR_T_USER0, 1105 1140 SH_ERR_T_USER1, 1141 SH_ERR_T_USER2, 1142 SH_ERR_T_USER3, 1143 SH_ERR_T_USER4, 1106 1144 SH_ERR_T_PRELINK, 1107 1145 }; -
trunk/src/sh_srp.c
r22 r27 384 384 } 385 385 386 #if def SH_WITH_CLIENT386 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 387 387 388 388 … … 489 489 490 490 491 #if def SH_WITH_CLIENT491 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 492 492 493 493 char * sh_srp_S_c (char * u_str, char * B_str) -
trunk/src/sh_tools.c
r22 r27 695 695 } 696 696 697 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) 697 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 698 698 static 699 699 int sh_write_select(int type, int sockfd, … … 842 842 #endif 843 843 844 #if defined (SH_WITH_CLIENT) 844 #if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 845 845 unsigned long write_port (int sockfd, char *buf, unsigned long nbytes, 846 846 int * w_error, int timeout) … … 862 862 #endif 863 863 864 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) 864 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 865 865 866 866 unsigned long read_port (int sockfd, char *buf, unsigned long nbytes, … … 898 898 #endif 899 899 900 #if defined (SH_WITH_CLIENT) 900 #if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 901 901 902 902 int check_request (char * have, char * need) … … 952 952 #endif 953 953 954 #if defined (SH_WITH_CLIENT) 954 #if defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER) 955 955 956 956 void get_header (unsigned char * head, unsigned long * bytes, char * u) … … 1032 1032 * (msg_size = payload_size - key_len = payload_size - 48) 1033 1033 */ 1034 1035 /* 1036 * only SH_V2_FULLSIZE is used, and only once 1037 */ 1038 #if 0 1034 1039 #ifdef SH_WITH_SERVER 1035 1040 #define SH_V2_FULLSIZE 240 … … 1041 1046 #define SH_V2_MESSAGE 960 1042 1047 #endif 1048 #endif 1049 #define SH_V2_FULLSIZE 1024 1043 1050 1044 1051 #ifdef SH_ENCRYPT … … 1383 1390 #endif 1384 1391 1385 #if defined (SH_WITH_CLIENT)1392 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 1386 1393 1387 1394 /* verify the checksum of a buffer; checksum comes first … … 1535 1542 #endif 1536 1543 1537 #if defined(SH_WITH_CLIENT) || defined(SH_ STEALTH) || defined(WITH_GPG) || defined(WITH_PGP)1544 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_GPG) || defined(WITH_PGP) 1538 1545 1539 1546 /* --------- secure temporary file ------------ */ -
trunk/src/sh_unix.c
r25 r27 127 127 unsigned long mask_USER0 = MASK_USER_; 128 128 unsigned long mask_USER1 = MASK_USER_; 129 unsigned long mask_USER2 = MASK_USER_; 130 unsigned long mask_USER3 = MASK_USER_; 131 unsigned long mask_USER4 = MASK_USER_; 129 132 unsigned long mask_ALLIGNORE = MASK_ALLIGNORE_; 130 133 unsigned long mask_ATTRIBUTES = MASK_ATTRIBUTES_; … … 142 145 mask_USER0 = MASK_USER_; 143 146 mask_USER1 = MASK_USER_; 147 mask_USER2 = MASK_USER_; 148 mask_USER3 = MASK_USER_; 149 mask_USER4 = MASK_USER_; 144 150 mask_ALLIGNORE = MASK_ALLIGNORE_; 145 151 mask_ATTRIBUTES = MASK_ATTRIBUTES_; -
trunk/src/sh_userfiles.c
r1 r27 221 221 else if ( strstr(s, "user0") != NULL ) new->level = SH_LEVEL_USER0; 222 222 else if ( strstr(s, "user1") != NULL ) new->level = SH_LEVEL_USER1; 223 else if ( strstr(s, "user2") != NULL ) new->level = SH_LEVEL_USER2; 224 else if ( strstr(s, "user3") != NULL ) new->level = SH_LEVEL_USER3; 225 else if ( strstr(s, "user4") != NULL ) new->level = SH_LEVEL_USER4; 223 226 else if ( strstr(s, "prelink") != NULL ) new->level = SH_LEVEL_PRELINK; 224 227 else /* The default */ new->level = default_level; … … 332 335 (void) sh_files_pushfile_user1(filepath); 333 336 break; 337 case SH_LEVEL_USER2: 338 (void) sh_files_pushfile_user2(filepath); 339 break; 340 case SH_LEVEL_USER3: 341 (void) sh_files_pushfile_user3(filepath); 342 break; 343 case SH_LEVEL_USER4: 344 (void) sh_files_pushfile_user4(filepath); 345 break; 334 346 case SH_LEVEL_PRELINK: 335 347 (void) sh_files_pushfile_prelink(filepath); -
trunk/test/test.sh
r22 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 isok=`test -t 1 2>&1 | wc -c` … … 288 307 rm -f testrc_1.dyn 289 308 rm -f testrc_2 309 rm -f testrc_22 290 310 rm -f ./.samhain_file 291 311 rm -f ./.samhain_log* 292 rm -f ./.samhain_lock 312 rm -f ./.samhain_lock* 293 313 test -d testrun_testdata && chmod -R 0700 testrun_testdata 294 314 test -d .quarantine && rm -rf .quarantine … … 296 316 rm -f test_log_db 297 317 rm -f test_log_prelude 298 rm -f test_log_valgrind 318 rm -f test_log_valgrind* 299 319 rm -f test_log_yulectl 300 320 rm -f yule.html 321 rm -f yule.html2 301 322 } 302 323 -
trunk/test/testcompile.sh
r22 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 MAXTEST=56; export MAXTEST -
trunk/test/testext.sh
r22 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 MAXTEST=1; export MAXTEST -
trunk/test/testhash.sh
r19 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 RCFILE="$PW_DIR/testrc_1.dyn"; export RCFILE -
trunk/test/testrun_1.sh
r25 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 RCFILE="$PW_DIR/testrc_1.dyn"; export RCFILE -
trunk/test/testrun_1a.sh
r19 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 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" -
trunk/test/testrun_1b.sh
r22 r27 1 1 #! /bin/sh 2 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 3 21 4 22 MAXTEST=2; export MAXTEST -
trunk/test/testrun_1c.sh
r21 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 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" -
trunk/test/testrun_2.sh
r22 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE … … 16 35 rm -f test_log_valgrind 17 36 18 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 37 ${VALGRIND} ./yule.2 -l info -p none >/dev/null 2>>test_log_valgrind & 38 PROC_Y2=$! 39 sleep 5 40 41 [ -z "$verbose" ] || { 42 echo; 43 echo "${S}Start Server #2${E}: ./yule.2 -l info -p none &"; 44 echo; 45 } 46 47 ${VALGRIND} ./yule -l info -p none -e info --bind-address=127.0.0.1 \ 48 --server-port=49778 >/dev/null 2>>test_log_valgrind & 19 49 PROC_Y=$! 20 50 sleep 5 … … 32 62 [ -z "$quiet" ] && log_msg_fail "samhain.new -t check"; 33 63 kill $PROC_Y 64 kill $PROC_Y2 34 65 return 1 35 66 fi 36 67 37 68 kill $PROC_Y 38 sleep 5 69 kill $PROC_Y2 70 sleep 5 71 72 # cp ${LOGFILE} triple_test 73 # cp ${LOGFILE}2 triple_test_2 74 75 egrep "START(>|\").*Yule(>|\")" ${LOGFILE}2 >/dev/null 2>&1 76 if [ $? -ne 0 ]; then 77 [ -z "$verbose" ] || log_msg_fail "Server #2 start"; 78 return 1 79 fi 80 egrep "remote_host.*Checking.*/bin" ${LOGFILE}2 >/dev/null 2>&1 81 if [ $? -ne 0 ]; then 82 [ -z "$verbose" ] || log_msg_fail "Client file check (relayed)"; 83 return 1 84 fi 85 egrep "remote_host.*EXIT.*Samhain" ${LOGFILE}2 >/dev/null 2>&1 86 if [ $? -ne 0 ]; then 87 [ -z "$verbose" ] || log_msg_fail "Client exit (relayed)"; 88 return 1 89 fi 90 egrep "EXIT.*Yule.*SIGTERM" ${LOGFILE}2 >/dev/null 2>&1 91 if [ $? -ne 0 ]; then 92 [ -z "$verbose" ] || log_msg_fail "Server #2 exit"; 93 return 1 94 fi 95 39 96 40 97 egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1 … … 195 252 rm -f test_log_valgrind 196 253 197 ${VALGRIND} ./yule -p none >/dev/null 2>>test_log_valgrind &254 ${VALGRIND} ./yule -p none -e none >/dev/null 2>>test_log_valgrind & 198 255 PROC_Y=$! 199 256 sleep 5 … … 292 349 rm -f test_log_valgrind 293 350 294 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 351 ${VALGRIND} ./yule -l info -p none -e none \ 352 >/dev/null 2>>test_log_valgrind & 295 353 PROC_Y=$! 296 354 sleep 5 … … 427 485 ) >entry.html 428 486 429 ${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind & 487 ${VALGRIND} ./yule -l info -p none -e none \ 488 >/dev/null 2>>test_log_valgrind & 430 489 PROC_Y=$! 431 490 sleep 5 432 491 433 492 egrep '<!-- head -->' $HTML >/dev/null 2>&1 493 if [ $? -ne 0 ]; then 494 # rm -f head.html; rm -f foot.html; rm -f entry.html; 495 kill $PROC_Y 496 [ -z "$verbose" ] || log_msg_fail "head.html (1)"; 497 return 1 498 fi 499 500 egrep '<!-- foot -->' $HTML >/dev/null 2>&1 434 501 if [ $? -ne 0 ]; then 435 502 rm -f head.html; rm -f foot.html; rm -f entry.html; 436 503 kill $PROC_Y 437 [ -z "$verbose" ] || log_msg_fail "head.html"; 438 return 1 439 fi 440 441 egrep '<!-- foot -->' $HTML >/dev/null 2>&1 442 if [ $? -ne 0 ]; then 443 rm -f head.html; rm -f foot.html; rm -f entry.html; 444 kill $PROC_Y 445 [ -z "$verbose" ] || log_msg_fail "foot.html"; 504 [ -z "$verbose" ] || log_msg_fail "foot.html (1)"; 446 505 return 1 447 506 fi … … 500 559 egrep '<!-- ehead -->' $HTML >/dev/null 2>&1 501 560 if [ $? -ne 0 ]; then 502 [ -z "$verbose" ] || log_msg_fail " head.html";561 [ -z "$verbose" ] || log_msg_fail "end head.html"; 503 562 return 1 504 563 fi … … 511 570 egrep '<!-- eentry -->' $HTML >/dev/null 2>&1 512 571 if [ $? -ne 0 ]; then 513 [ -z "$verbose" ] || log_msg_fail "en try.html";572 [ -z "$verbose" ] || log_msg_fail "end entry.html"; 514 573 return 1 515 574 fi … … 522 581 egrep '<!-- efoot -->' $HTML >/dev/null 2>&1 523 582 if [ $? -ne 0 ]; then 524 [ -z "$verbose" ] || log_msg_fail " foot.html";583 [ -z "$verbose" ] || log_msg_fail "end foot.html"; 525 584 return 1 526 585 fi … … 571 630 fi 572 631 573 # save binary and build server 632 # save binary and build server2 574 633 # 575 634 cp samhain samhain.build || return 1 576 635 make clean >/dev/null || return 1 577 636 578 ${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=2637 ${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 579 638 # 580 639 if test x$? = x0; then … … 593 652 fi 594 653 654 # save binary and build server 655 # 656 cp yule yule.2 || return 1 657 make clean >/dev/null || return 1 658 659 ${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 660 # 661 if test x$? = x0; then 662 [ -z "$verbose" ] || log_msg_ok "configure..."; 663 $MAKE > /dev/null 2>>test_log 664 if test x$? = x0; then 665 [ -z "$verbose" ] || log_msg_ok "make..."; 666 else 667 [ -z "$quiet" ] && log_msg_fail "make..."; 668 return 1 669 fi 670 671 else 672 [ -z "$quiet" ] && log_msg_fail "configure..."; 673 return 1 674 fi 675 595 676 596 677 ##################################################################### … … 633 714 mv samhain.build.new samhain.new || return 1 634 715 635 rm -f ./.samhain_log.* 636 rm -f ./.samhain_lock 716 # Set in server 717 718 ./samhain_setpwd yule new $SHPW >/dev/null 719 720 if test x$? = x0; then 721 [ -z "$verbose" ] || log_msg_ok "./samhain_setpwd yule new $SHPW"; 722 else 723 [ -z "$quiet" ] && log_msg_fail "./samhain_setpwd yule new $SHPW"; 724 return 1 725 fi 726 727 mv yule.new yule || return 1 728 729 # 730 731 rm -f ./.samhain_log* 732 rm -f ./.samhain_lock* 637 733 638 734 SHCLT=`./yule -P $SHPW | sed s%HOSTNAME%${SH_LOCALHOST}%` … … 646 742 647 743 echo $SHCLT >> testrc_2 744 cp testrc_2 testrc_22 648 745 649 746 do_test_1 -
trunk/test/testrun_2a.sh
r25 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE -
trunk/test/testrun_2b.sh
r22 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE -
trunk/test/testrun_2c.sh
r19 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 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 -
trunk/test/testrun_2d.sh
r22 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 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 -
trunk/test/testtimesrv.sh
r19 r27 1 1 #! /bin/sh 2 3 # 4 # Copyright Rainer Wichmann (2006) 5 # 6 # License Information: 7 # This program is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # This program is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program; if not, write to the Free Software 19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 # 2 21 3 22 RCFILE="$PW_DIR/testrc_1.dyn"; export RCFILE
Note:
See TracChangeset
for help on using the changeset viewer.