Legend:
- Unmodified
- Added
- Removed
-
trunk/src/samhain.c
r52 r59 652 652 sh_files_delfilestack (); 653 653 sh_hash_hashdelete(); 654 sh_files_hle_reg (NULL); 654 655 #endif 655 656 #if defined(SH_WITH_SERVER) … … 1369 1370 } 1370 1371 1371 /* initialize signal handling etc1372 */1373 1372 if (sh.flag.isdaemon == S_TRUE) 1374 1373 sh_error_only_stderr (BAD); 1375 1374 1375 /* --- load database; checksum of database 1376 */ 1377 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 1378 TPT((0, FIL__, __LINE__, _("msg=<Get checksum of the database.>\n"))) 1379 if (sh.flag.checkSum == SH_CHECK_CHECK) 1380 { 1381 if (0 != sl_strcmp(file_path('D', 'R'), _("REQ_FROM_SERVER"))) 1382 { 1383 (void) sl_strlcpy(sh.data.hash, 1384 sh_tiger_hash (file_path('D', 'R'), 1385 TIGER_FILE, 0), 1386 KEY_LEN+1); 1387 } 1388 1389 /* this eventually fetches the file from server to get checksum 1390 */ 1391 sh_hash_init (); 1392 } 1393 #endif 1394 1395 /* --- initialize signal handling etc.; fork daemon 1396 */ 1376 1397 if (sh_unix_init(sh.flag.isdaemon) == -1) 1377 1398 { … … 1409 1430 #if defined(INET_SYSLOG) && defined(SH_WITH_SERVER) 1410 1431 create_syslog_socket (S_FALSE); 1411 #endif1412 1413 1414 /* checksum of database1415 */1416 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)1417 TPT((0, FIL__, __LINE__, _("msg=<Get checksum of the database.>\n")))1418 if (sh.flag.checkSum == SH_CHECK_CHECK)1419 {1420 if (0 == sl_strcmp(file_path('D', 'R'), _("REQ_FROM_SERVER")))1421 {1422 /* fetch the file from server to get checksum1423 */1424 sh_hash_init ();1425 /* sh_hash_hashdelete (); */1426 }1427 else1428 {1429 (void) sl_strlcpy(sh.data.hash,1430 sh_tiger_hash (file_path('D', 'R'),1431 TIGER_FILE, 0),1432 KEY_LEN+1);1433 }1434 }1435 1432 #endif 1436 1433 -
trunk/src/sh_unix.c
r52 r59 2843 2843 SL_ENTER(_("sh_unix_checksum_size")); 2844 2844 2845 /* lookup file in database */ 2846 status = sh_hash_get_it (filename, &tmpFile); 2847 if (status != 0) { 2848 goto out; 2849 } 2845 if (sh.flag.checkSum != SH_CHECK_INIT) 2846 { 2847 /* lookup file in database */ 2848 status = sh_hash_get_it (filename, &tmpFile); 2849 if (status != 0) { 2850 goto out; 2851 } 2852 } 2853 else 2854 { 2855 tmpFile.size = fbuf->st_size; 2856 } 2850 2857 2851 2858 /* if last < current get checksum */ … … 2853 2860 { 2854 2861 sl_strlcpy(fileHash, 2855 sh_tiger_generic_hash (filename, TIGER_FD, tmpFile.size,2856 2857 KEY_LEN+1);2862 sh_tiger_generic_hash (filename, TIGER_FD, tmpFile.size, 2863 alert_timeout), 2864 KEY_LEN+1); 2858 2865 2859 2866 /* return */
Note:
See TracChangeset
for help on using the changeset viewer.