Changeset 115 for trunk/src/sh_suidchk.c
- Timestamp:
- Aug 21, 2007, 10:22:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_suidchk.c
r114 r115 831 831 struct stat buf; 832 832 int status; 833 int fflags; 833 834 char * fs; 834 835 long sl_status = SL_ENONE; … … 910 911 ++FileLimTotal; 911 912 913 /* Rate limit (Fps == Files per second) 914 */ 912 915 if ((ShSuidchkFps > 0 && FileLimNum > ShSuidchkFps && FileLimTotal > 0)&& 913 916 (ShSuidchkYield == S_FALSE)) … … 995 998 else 996 999 { 997 if (sh.flag.update == S_TRUE && 1000 1001 if ( sh.flag.update == S_TRUE && 998 1002 (sh.flag.checkSum == SH_CHECK_INIT || 999 1003 sh.flag.checkSum == SH_CHECK_CHECK)) 1000 1004 { 1005 /* Updating database. Report new files that 1006 * are not in database already. Then compare 1007 * to database and report changes. 1008 */ 1001 1009 if (-1 == sh_hash_have_it (tmpcat)) 1002 1010 { … … 1017 1025 sh_hash_pushdata_memory (&theFile, fileHash); 1018 1026 } 1027 1028 sh_hash_addflag(tmpcat, SH_FFLAG_SUIDCHK); 1029 1019 1030 } 1031 1020 1032 else if (sh.flag.checkSum == SH_CHECK_INIT && 1021 1033 sh.flag.update == S_FALSE ) 1022 1034 { 1035 /* Running init. Report on files detected. 1036 */ 1023 1037 sh_hash_pushdata (&theFile, fileHash); 1024 1038 sh_error_handle ((-1), FIL__, __LINE__, 1025 1039 0, MSG_SUID_FOUND, tmp ); 1026 1040 } 1041 1027 1042 else if (sh.flag.checkSum == SH_CHECK_CHECK ) 1028 1043 { 1044 /* Running file check. Report on new files 1045 * detected, and quarantine them. 1046 */ 1029 1047 sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 1030 1048 0, MSG_SUID_FOUND, tmp ); 1031 if (-1 == sh_hash_have_it (tmpcat)) 1049 1050 fflags = sh_hash_getflags(tmpcat); 1051 1052 if ( (-1 == fflags) || (!SH_FFLAG_SUIDCHK_SET(fflags))) 1032 1053 { 1033 report_file(tmpcat, &theFile, timestrc, timestra, timestrm); 1054 if (-1 == fflags) 1055 report_file(tmpcat, &theFile, timestrc, timestra, timestrm); 1034 1056 1035 1057 /* Quarantine file according to configured method … … 1063 1085 _("[SuidCheck]"), 1064 1086 ShSuidchkSeverity); 1087 1088 sh_hash_addflag(tmpcat, SH_FFLAG_SUIDCHK); 1089 1065 1090 } 1066 1091 } 1067 1092 else 1068 1093 { 1094 /* File exists. Check for modifications. 1095 */ 1069 1096 (void) sh_hash_compdata (SH_LEVEL_READONLY, 1070 1097 &theFile, fileHash, 1071 1098 _("[SuidCheck]"), 1072 1099 ShSuidchkSeverity); 1100 1101 sh_hash_addflag(tmpcat, SH_FFLAG_SUIDCHK); 1102 1073 1103 } 1074 1104 }
Note:
See TracChangeset
for help on using the changeset viewer.