Changeset 257
- Timestamp:
- Oct 31, 2009, 8:53:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.in
r245 r257 1184 1184 @$(MAKE) CUTEST='-DSH_CUTEST=1' intcutest 1185 1185 1186 intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/make-tests.sh 1187 cd $(srcsrc)/ && ./make-tests.sh >CuTestMain.c 1186 $(srcsrc)/CuTestMain.c: $(SOURCES) $(CUTEST_SOURCES) $(srcsrc)/make-tests.sh 1187 cd $(srcsrc)/ && ./make-tests.sh >CuTestMain.c; 1188 1189 intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/CuTestMain.c 1188 1190 @$(COMPILE) -o CuTestMain.o -c $(srcsrc)/CuTestMain.c; \ 1189 1191 $(COMPILE) -o CuTest.o -c $(srcsrc)/CuTest.c; \ -
trunk/configure.ac
r255 r257 12 12 dnl start 13 13 dnl 14 AM_INIT_AUTOMAKE(samhain, 2. 5.10)14 AM_INIT_AUTOMAKE(samhain, 2.6.0) 15 15 AC_DEFINE([SAMHAIN], 1, [Application is samhain]) 16 16 AC_CANONICAL_HOST -
trunk/docs/Changelog
r256 r257 1 1 2.6.0: 2 * fix bug with parallel compilation of cutest in Makefile 3 * sh_mem.c: fix deadlock in debug-only code 2 4 * Evaluate glob patterns for each run of file check 3 5 * Add compile option to disable compiling with SSP -
trunk/src/sh_cat.c
r206 r257 260 260 { MSG_MSTAMP, SH_ERR_STAMP, STAMP, N_("msg=\"Memory used: max.=%lu, current=%lu\"")}, 261 261 { MSG_MSTAMP2, SH_ERR_STAMP, STAMP, N_("msg=\"Blocks: %d allocated, %d freed, %d maximum\"")}, 262 { MSG_E_MNULL, SH_ERR_ERR, ERR, N_("msg=\"Dereferenced NULL pointer \" source_file=\"%s\" source_line=\"%d\"")},262 { MSG_E_MNULL, SH_ERR_ERR, ERR, N_("msg=\"Dereferenced NULL pointer allocated in %s, line %d\" source_file=\"%s\" source_line=\"%d\"")}, 263 263 { MSG_E_MMEM, SH_ERR_ERR, ERR, N_("msg=\"Out of memory\" source_file=\"%s\" source_line=\"%d\"")}, 264 264 { MSG_E_MREC, SH_ERR_ERR, ERR, N_("msg=\"Free() on unrecorded block\" source_file=\"%s\" source_line=\"%d\"")}, -
trunk/src/sh_log_check.c
r252 r257 811 811 int sh_log_check_init (struct mod_type * arg) 812 812 { 813 #if !defined(HAVE_PTHREAD) 814 (void) arg; 815 #endif 816 813 817 if (ShLogmonActive == S_FALSE) 814 818 return SH_MOD_FAILED; -
trunk/src/sh_mem.c
r256 r257 112 112 #endif 113 113 114 static void ** sh_mem_merr_1; 115 114 116 void sh_mem_stat () 115 117 { 116 118 memlist_t * this; 117 119 memlist_t * merrlist = NULL; 118 120 119 121 SL_ENTER(_("sh_mem_stat")); 120 122 123 sh_mem_merr_1 = (void **) &merrlist; 121 124 122 125 if (Alloc_Count == Free_Count) … … 139 142 while (this != NULL) 140 143 { 144 memlist_t * merr = (memlist_t *) malloc (sizeof(memlist_t)); 145 146 memcpy(merr, this, sizeof(memlist_t)); 147 merr->next = merrlist; 148 merrlist = merr; 149 150 this = this->next; 151 } 152 153 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 154 155 while (merrlist != NULL) 156 { 157 memlist_t * tmp = merrlist; 158 merrlist = merrlist->next; 159 141 160 sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_NOTFREE, 142 this->size, this->file, this->line); 143 this = this->next; 144 } 145 146 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 161 tmp->size, tmp->file, tmp->line); 162 free(tmp); 163 } 164 147 165 SL_RET0(_("sh_mem_stat")); 148 166 } 149 167 168 static void ** sh_mem_merr_2; 169 150 170 void sh_mem_check () 151 171 { 152 172 memlist_t * this; 173 memlist_t * merrlist = NULL; 174 memlist_t * merr; 153 175 long nerr = 0; 154 176 155 177 SL_ENTER(_("sh_mem_check")); 178 179 sh_mem_merr_2 = (void **) &merrlist; 156 180 157 181 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_MSTAMP, … … 167 191 if ( this->address == NULL ) 168 192 { 169 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL); 193 merr = (memlist_t *) malloc (sizeof(memlist_t)); 194 195 memcpy(merr, this, sizeof(memlist_t)); 196 merr->size = 2; 197 198 merr->next = merrlist; 199 merrlist = merr; 170 200 ++nerr; 171 201 } … … 174 204 if ( this->address[this->size] != CHECKBYTE ) 175 205 { 176 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 177 this->file, this->line, FIL__, __LINE__); 206 merr = (memlist_t *) malloc (sizeof(memlist_t)); 207 208 memcpy(merr, this, sizeof(memlist_t)); 209 merr->size = 1; 210 211 merr->next = merrlist; 212 merrlist = merr; 178 213 ++nerr; 179 214 } 180 215 if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE ) 181 216 { 182 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 183 this->file, this->line, FIL__, __LINE__); 217 merr = (memlist_t *) malloc (sizeof(memlist_t)); 218 219 memcpy(merr, this, sizeof(memlist_t)); 220 merr->size = 0; 221 222 merr->next = merrlist; 223 merrlist = merr; 184 224 ++nerr; 185 225 } … … 190 230 191 231 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 232 233 while (merrlist != NULL) 234 { 235 memlist_t * tmp = merrlist; 236 merrlist = merrlist->next; 237 238 if (tmp->size == 2) 239 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL, 240 tmp->file, tmp->line, FIL__, __LINE__); 241 if (tmp->size == 1) 242 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 243 tmp->file, tmp->line, FIL__, __LINE__); 244 else 245 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 246 tmp->file, tmp->line, FIL__, __LINE__); 247 free(tmp); 248 } 249 192 250 SL_RET0(_("sh_mem_check")); 193 251 } … … 203 261 SH_MUTEX_RECURSIVE_INIT(mutex_mem); 204 262 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 263 205 264 the_realAddress = malloc(size + 2 * SH_MEMMULT); 206 265 … … 258 317 259 318 static void ** sh_mem_dummy_a; 319 static void ** sh_mem_merr_3; 260 320 261 321 void sh_mem_free (void * aa, char * file, int line) … … 263 323 memlist_t * this; 264 324 memlist_t * before; 325 memlist_t * merr; 326 memlist_t * merrlist = NULL; 265 327 unsigned long size = 0; 266 328 void * a; … … 271 333 a = aa; 272 334 sh_mem_dummy_a = &a; 335 sh_mem_merr_3 = (void **) &merrlist; 273 336 274 337 … … 276 339 { 277 340 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL, 278 file, line );341 file, line, FIL__, __LINE__); 279 342 SL_RET0(_("sh_mem_free")); 280 343 } … … 307 370 if ( this->address[this->size] != CHECKBYTE ) 308 371 { 309 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 310 this->file, this->line, file, line); 372 merr = (memlist_t *) malloc (sizeof(memlist_t)); 373 374 memcpy(merr, this, sizeof(memlist_t)); 375 merr->size = 1; 376 377 merr->next = merrlist; 378 merrlist = merr; 311 379 } 380 312 381 if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE ) 313 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 314 this->file, this->line, file, line); 382 { 383 merr = (memlist_t *) malloc (sizeof(memlist_t)); 384 385 memcpy(merr, this, sizeof(memlist_t)); 386 merr->size = 0; 387 388 merr->next = merrlist; 389 merrlist = merr; 390 } 315 391 316 392 size = this->size; … … 325 401 if (this) 326 402 free(this); 403 327 404 ++Free_Count; 328 405 --Now_Alloc_Count; … … 332 409 ; /* label at end of compound statement */ 333 410 SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem); 411 412 while (merrlist != NULL) 413 { 414 memlist_t * tmp = merrlist; 415 merrlist = merrlist->next; 416 417 if (tmp->size == 1) 418 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER, 419 tmp->file, tmp->line, file, line); 420 else 421 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER, 422 tmp->file, tmp->line, file, line); 423 free(tmp); 424 } 425 334 426 if (flag != 0) 335 427 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MREC, 336 428 file, line); 429 337 430 SL_RET0(_("sh_mem_free")); 338 431 } -
trunk/src/sh_portcheck.c
r253 r257 1618 1618 if (sh_portchk_active != S_FALSE) 1619 1619 { 1620 #ifdef SL_DEBUG1621 sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,1622 _("Checking for open ports"),1623 _("sh_portchk_check"));1624 #else1625 1620 sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN, 1626 1621 _("Checking for open ports"), 1627 1622 _("sh_portchk_check")); 1628 #endif1629 1623 1630 1624 sh_portchk_reset_lists(); -
trunk/src/sh_processcheck.c
r253 r257 1360 1360 { 1361 1361 SH_MUTEX_LOCK(mutex_thread_nolog); 1362 #ifdef SL_DEBUG1363 sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_PCK_CHECK,1364 (unsigned long) sh_prochk_minpid,1365 (unsigned long) (sh_prochk_maxpid-1));1366 #else1367 1362 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_PCK_CHECK, 1368 1363 (unsigned long) sh_prochk_minpid, 1369 1364 (unsigned long) (sh_prochk_maxpid-1)); 1370 #endif1371 1365 SH_MUTEX_UNLOCK(mutex_thread_nolog); 1372 1366 -
trunk/src/sh_suidchk.c
r253 r257 1456 1456 1457 1457 SH_MUTEX_LOCK(mutex_thread_nolog); 1458 sh_error_handle (SH_ERR_ NOTICE, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,1458 sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN, 1459 1459 _("Checking for SUID programs"), 1460 _("s uidchk_check") );1460 _("sh_suidchk_check") ); 1461 1461 SH_MUTEX_UNLOCK(mutex_thread_nolog); 1462 1462 -
trunk/test/testcompile.sh
r227 r257 179 179 echo getenv >> list_null_funcs_uniq; 180 180 cat $i | ./deference_check.pl |\ 181 egrep -v 'x_trustfile.c ... ... sl_trustfile'; 181 egrep -v 'x_trustfile.c ... ... sl_trustfile' | \ 182 egrep -v 'x_sh_mem.c '; 182 183 rm -f list_null_funcs_uniq; 183 184 # rm -f $i … … 262 263 numfail=0 263 264 265 266 C_LOGFILE="" 267 268 ls /lib/libpcre* >/dev/null 2>&1 269 if [ $? -eq 0 ]; then 270 C_LOGFILE=" --enable-logfile-monitor " 271 else 272 ls /usr/lib/libpcre* >/dev/null 2>&1 273 if [ $? -eq 0 ]; then 274 C_LOGFILE=" --enable-logfile-monitor " 275 else 276 ls /usr/local/lib/libpcre* >/dev/null 2>&1 277 if [ $? -eq 0 ]; then 278 C_LOGFILE=" --enable-logfile-monitor " 279 fi 280 fi 281 fi 282 if [ x"${C_LOGFILE}" = x ]; then 283 log_msg_ok "Not testing --enable-logfile-monitor"; 284 fi 285 264 286 # 265 287 # test dnmalloc … … 319 341 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; } 320 342 # 321 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-static --enable-suidcheck --enable-process-check --enable-logfile-monitor> /dev/null 2>> test_log343 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-static --enable-suidcheck --enable-process-check ${C_LOGFILE} > /dev/null 2>> test_log 322 344 # 323 345 let "num = num + 1" >/dev/null … … 429 451 fi 430 452 # 431 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-logfile-monitor> /dev/null 2>> test_log453 ${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log 432 454 # 433 455 let "num = num + 1" >/dev/null … … 670 692 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; SMATCH=""; export SMATCH; } 671 693 # 672 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 --enable-logfile-monitor> /dev/null 2>> test_log694 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-timeserver=127.0.0.1 ${C_LOGFILE} > /dev/null 2>> test_log 673 695 # 674 696 let "num = num + 1" >/dev/null … … 726 748 fi 727 749 # 728 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-logfile-monitor> /dev/null 2>> test_log750 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-srp --with-gpg=$GPG --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log 729 751 # 730 752 let "num = num + 1" >/dev/null … … 790 812 fi 791 813 # 792 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --enable-logfile-monitor> /dev/null 2>> test_log814 ${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log 793 815 # 794 816 let "num = num + 1" >/dev/null -
trunk/test/testhash.sh
r235 r257 28 28 { 29 29 log_start "HASH FUNCTION" 30 31 C_LOGFILE="" 32 33 ls /lib/libpcre* >/dev/null 2>&1 34 if [ $? -eq 0 ]; then 35 C_LOGFILE=" --enable-logfile-monitor " 36 else 37 ls /usr/lib/libpcre* >/dev/null 2>&1 38 if [ $? -eq 0 ]; then 39 C_LOGFILE=" --enable-logfile-monitor " 40 else 41 ls /usr/local/lib/libpcre* >/dev/null 2>&1 42 if [ $? -eq 0 ]; then 43 C_LOGFILE=" --enable-logfile-monitor " 44 fi 45 fi 46 fi 47 if [ x"${C_LOGFILE}" = x ]; then 48 log_msg_ok "Not testing --enable-logfile-monitor"; 49 fi 50 30 51 # 31 52 # test standalone compilation … … 37 58 fi 38 59 # 39 ${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug '--enable-login-watch' '--enable-mounts-check' '--enable-logfile-monitor''--enable-process-check' '--enable-port-check' '--enable-suidcheck' '--with-rnd=unix'60 ${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug '--enable-login-watch' '--enable-mounts-check' ${C_LOGFILE} '--enable-process-check' '--enable-port-check' '--enable-suidcheck' '--with-rnd=unix' 40 61 # 41 62 fail=0 -
trunk/test/testrun_1.sh
r207 r257 892 892 return 1 893 893 fi 894 egrep "CRIT.*POLICY \[ReadOnly\] CL- --M--TS.*${BASE}/b/l_x" $LOGFILE >/dev/null 2>&1894 egrep "CRIT.*POLICY \[ReadOnly\] CL-.-M--TS.*${BASE}/b/l_x" $LOGFILE >/dev/null 2>&1 895 895 if [ $? -ne 0 ]; then 896 896 [ -z "$verbose" ] || log_msg_fail "${BASE}/b/l_x";
Note:
See TracChangeset
for help on using the changeset viewer.