Changeset 25
- Timestamp:
- Mar 14, 2006, 10:27:38 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r23 r25 1091 1091 CUTEST_SOURCES = $(srcsrc)/cutest_sh_tools.c \ 1092 1092 $(srcsrc)/cutest_sh_utils.c \ 1093 $(srcsrc)/cutest_sh_unix.c \ 1093 1094 $(srcsrc)/cutest_slib.c \ 1094 1095 $(srcsrc)/cutest_zAVLTree.c \ … … 1097 1098 CUTEST_OBJECTS = cutest_sh_tools.o \ 1098 1099 cutest_sh_utils.o \ 1100 cutest_sh_unix.o \ 1099 1101 cutest_slib.o \ 1100 1102 cutest_zAVLTree.o \ -
trunk/docs/Changelog
r22 r25 1 1 2.2.0: 2 * patch by Yoann Vandoorselaere for sh_prelude.c 2 3 * allow --longopt arg as well as --longopt=arg 3 * fix minor problem with dead clienbt detection (problem reported4 by M. Kustosik)5 4 * verify checksum of growing log files 6 5 * rewrite of the test suite 7 6 * added a bit of unit testing 8 * improved the windows howto according to suggestions by9 Jorge Morgado10 7 * minor optimizations in various places 11 8 * optimized implementation of tiger checksum algorithm … … 20 17 * slib.c: remove fcntl's from sl_read_timeout (caller sets O_NONBLOCK), 21 18 add function sl_read_timeout_prep 19 20 2.1.3 (13-03-2006): 21 * fix compile problem in slib.c (reported by Lawrence Bowie) 22 * fix bug with combination of one-shot update mode and file check 23 schedule (reportedby Dan Track) 24 * improved the windows howto according to suggestions by 25 Jorge Morgado 26 * fix samhain_hide kernel module for new linux kernel versions 27 * fix minor problem with dead client detection (problem reported 28 by Michal Kustosik) 22 29 23 30 2.1.2 (10-01-2006): -
trunk/dsys/comDOWNLOAD
r1 r25 111 111 if test -z "$command" 112 112 then 113 printFATAL "No wget, curl, lynx, links, lwp-request, fetch in your \$PATH, cannot download"113 printFATAL "No wget, curl, lynx, links, lwp-request, fetch, fget in your \$PATH, cannot download" 114 114 fi 115 115 -
trunk/include/samhain.h
r22 r25 301 301 int safe_fatal (int signal, int method, char * details, char *f, int l); 302 302 303 #define SH_VAL _EQ(a,b) \303 #define SH_VALIDATE_EQ(a,b) \ 304 304 do { \ 305 305 if ((a) != (b)) safe_fatal(0, 0, #a " != " #b, FIL__, __LINE__);\ 306 306 } while (0) 307 307 308 #define SH_VALIDATE_NE(a,b) \ 309 do { \ 310 if ((a) == (b)) safe_fatal(0, 0, #a " == " #b, FIL__, __LINE__);\ 311 } while (0) 308 312 309 313 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK) -
trunk/include/sh_unix.h
r22 r25 141 141 int sh_unix_munlock(void * addr, size_t len); 142 142 int sh_unix_count_mlock(); 143 /* public for unit tests */ 144 int sh_unix_pagesize(); 145 unsigned long sh_unix_lookup_page(void * in_addr, size_t len, int * num_pages); 143 146 144 147 /* chroot directory -
trunk/src/samhain.c
r22 r25 1795 1795 /* see whether its time to check files 1796 1796 */ 1797 if (sh.flag.checkSum == SH_CHECK_INIT) 1797 if (sh.flag.checkSum == SH_CHECK_INIT || 1798 (sh.flag.checkSum == SH_CHECK_CHECK && 1799 (sh.flag.isdaemon == S_FALSE && sh.flag.loop == S_FALSE))) 1798 1800 { 1799 1801 flag_check_1 = 1; -
trunk/src/sh_html.c
r22 r25 313 313 sl_strlcat(&entry_orig[entry_size], line, line_size + 1); 314 314 entry_size += add_size; 315 SH_VAL _EQ(entry_orig[entry_size], '\0');315 SH_VALIDATE_EQ(entry_orig[entry_size], '\0'); 316 316 } 317 317 sl_close(fd); -
trunk/src/sh_unix.c
r22 r25 4024 4024 { 4025 4025 #ifdef WITH_TPT 4026 sl_snprintf(str, 128, _("file: %s line: %d page: %d"),4026 sl_snprintf(str, sizeof(str), _("file: %s line: %d page: %d"), 4027 4027 page_list->file, page_list->line, i+1); 4028 4028 sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, i, MSG_E_SUBGEN, … … 4032 4032 ++i; 4033 4033 } 4034 sl_snprintf(str, 128, _("%d pages locked"), i);4034 sl_snprintf(str, sizeof(str), _("%d pages locked"), i); 4035 4035 sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, i, MSG_E_SUBGEN, 4036 4036 str, _("sh_unix_count_mlock")); -
trunk/src/sh_utils.c
r22 r25 205 205 SL_ENTER(_("sh_util_strdup")); 206 206 207 if (str != NULL)208 { 209 210 211 212 } 207 SH_VALIDATE_NE(str, NULL); 208 209 len = sl_strlen(str); 210 p = SH_ALLOC (len + 1); 211 (void) sl_strlcpy (p, str, len+1); 212 213 213 SL_RETURN( p, _("sh_util_strdup")); 214 214 } … … 224 224 ret = *str; 225 225 226 if (ret == NULL) { 227 SL_RETURN(ret, _("sh_util_strsep")); 228 } 226 SH_VALIDATE_NE(ret, NULL); 229 227 230 228 for (c = *str; *c != '\0'; c++) { -
trunk/src/slib.c
r22 r25 577 577 578 578 #if !defined(HOST_IS_I86SOLARIS) 579 #if !defined (_GNU_SOURCE) 579 #if !defined (_GNU_SOURCE) && !defined(__linux__) 580 580 /* flawfinder: ignore */ 581 581 extern int vsnprintf ( char *str, size_t n, -
trunk/test/testrun_1.sh
r22 r25 22 22 testrun1_setup=0 23 23 24 MAXTEST=1 0; export MAXTEST24 MAXTEST=11; export MAXTEST 25 25 26 26 test_dirs () { … … 46 46 fi 47 47 done 48 } 49 50 # 51 # combine file check schedule with one-shot mode 52 # 53 TESTPOLICY_11=" 54 [ReadOnly] 55 dir=99${BASE} 56 " 57 58 mod_testdata_11 () { 59 sleep 1 60 echo "foobar" >"${BASE}/c/x"; # bad 61 chmod 0555 "${BASE}/a/y"; # bad 62 ORIGINAL='SetFilecheckTime=60' 63 REPLACEMENT='FileCheckScheduleOne = 6 12 * * *' 64 ex $RCFILE <<EOF 65 :%s/${ORIGINAL}/${REPLACEMENT}/g 66 :wq 67 EOF 68 } 69 70 chk_testdata_11 () { 71 # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c"; 72 tmp=`grep CRIT $LOGFILE | wc -l` 73 if [ $tmp -ne 2 ]; then 74 [ -z "$verbose" ] || log_msg_fail "policy count"; 75 return 1 76 fi 77 egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/c/x" $LOGFILE >/dev/null 2>&1 78 if [ $? -ne 0 ]; then 79 [ -z "$verbose" ] || log_msg_fail "${BASE}/c/x"; 80 return 1 81 fi 82 egrep "CRIT.*POLICY \[ReadOnly\] -----M--T-.*${BASE}/a/y" $LOGFILE >/dev/null 2>&1 83 if [ $? -ne 0 ]; then 84 [ -z "$verbose" ] || log_msg_fail "${BASE}/a/y"; 85 return 1 86 fi 87 CDIRS="a a/a a/b a/c c b a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c"; 88 NDIRS=""; 89 test_dirs; 90 return $? 48 91 } 49 92 -
trunk/test/testrun_2a.sh
r22 r25 140 140 rm -f ./rc.${SH_LOCALHOST} 141 141 rm -f ./file.${SH_LOCALHOST} 142 rm -f "./rc.${ALTHOST}" 143 rm -f "./file.${ALTHOST}" 142 144 143 145 cp ${SCRIPTDIR}/testrc_2.in testrc_2 … … 196 198 } 197 199 198 MAXTEST= 1; export MAXTEST200 MAXTEST=5; export MAXTEST 199 201 200 202 testrun2a () … … 209 211 # 210 212 testrun2a_internal 211 #212 213 do_test_1_a 213 214 if [ $? -eq 0 ]; then … … 215 216 else 216 217 [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client download+logging"; 218 fi 219 # 220 SERVER_BUILDOPTS_ORIG="${SERVER_BUILDOPTS}" 221 CLIENT_BUILDOPTS_ORIG="${CLIENT_BUILDOPTS}" 222 # 223 SERVER_BUILDOPTS="${SERVER_BUILDOPTS_ORIG} --disable-srp" 224 CLIENT_BUILDOPTS="${CLIENT_BUILDOPTS_ORIG} --disable-srp" 225 # 226 testrun2a_internal 227 do_test_1_a 228 if [ $? -eq 0 ]; then 229 [ -z "$quiet" ] && log_ok 2 ${MAXTEST} "SRP disabled"; 230 else 231 [ -z "$quiet" ] && log_fail 2 ${MAXTEST} "SRP disabled"; 232 fi 233 # 234 SERVER_BUILDOPTS="${SERVER_BUILDOPTS_ORIG} --disable-encrypt" 235 CLIENT_BUILDOPTS="${CLIENT_BUILDOPTS_ORIG} --disable-encrypt" 236 # 237 testrun2a_internal 238 do_test_1_a 239 if [ $? -eq 0 ]; then 240 [ -z "$quiet" ] && log_ok 3 ${MAXTEST} "Encryption disabled"; 241 else 242 [ -z "$quiet" ] && log_fail 3 ${MAXTEST} "Encryption disabled"; 243 fi 244 # 245 SERVER_BUILDOPTS="${SERVER_BUILDOPTS_ORIG} --enable-encrypt=1" 246 CLIENT_BUILDOPTS="${CLIENT_BUILDOPTS_ORIG} --enable-encrypt=1" 247 # 248 testrun2a_internal 249 do_test_1_a 250 if [ $? -eq 0 ]; then 251 [ -z "$quiet" ] && log_ok 4 ${MAXTEST} "Encryption (v1)"; 252 else 253 [ -z "$quiet" ] && log_fail 4 ${MAXTEST} "Encryption (v1)"; 254 fi 255 # 256 SERVER_BUILDOPTS="${SERVER_BUILDOPTS_ORIG}" 257 CLIENT_BUILDOPTS="${CLIENT_BUILDOPTS_ORIG} --enable-encrypt=1" 258 # 259 testrun2a_internal 260 do_test_1_a 261 if [ $? -eq 0 ]; then 262 [ -z "$quiet" ] && log_ok 5 ${MAXTEST} "Encryption backward compat"; 263 else 264 [ -z "$quiet" ] && log_fail 5 ${MAXTEST} "Encryption backward compat"; 217 265 fi 218 266 #
Note:
See TracChangeset
for help on using the changeset viewer.