Changeset 481 for trunk/src/sh_suidchk.c
- Timestamp:
- Jul 18, 2015, 5:06:52 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_suidchk.c
r474 r481 78 78 #include "sh_suidchk.h" 79 79 #include "sh_hash.h" 80 #include "sh_dbIO.h" 80 81 #include "sh_unix.h" 81 82 #include "sh_files.h" … … 140 141 static int ShSuidchkActive = S_TRUE; 141 142 static time_t ShSuidchkInterval = 7200; 142 static long ShSuidchkFps = 0;143 static unsigned long ShSuidchkFps = 0; 143 144 static int ShSuidchkNosuid = S_FALSE; 144 145 static int ShSuidchkYield = S_FALSE; … … 150 151 static time_t FileLimNow = 0; 151 152 static time_t FileLimStart = 0; 152 static long FileLimNum = 0;153 static long FileLimTotal = 0;153 static unsigned long FileLimNum = 0; 154 static unsigned long FileLimTotal = 0; 154 155 155 156 static sh_schedule_t * ShSuidchkSched = NULL; … … 1134 1135 /* Rate limit (Fps == Files per second) 1135 1136 */ 1136 if ((ShSuidchkFps > 0 && FileLimNum > ShSuidchkFps && FileLimTotal > 0)&&1137 if ((ShSuidchkFps > 0 && FileLimNum > ShSuidchkFps) && 1137 1138 (ShSuidchkYield == S_FALSE)) 1138 1139 { … … 1222 1223 int dummy; 1223 1224 int class; 1224 unsigned long check_ mask= 0;1225 unsigned long check_flags = 0; 1225 1226 1226 1227 theFile = SH_ALLOC(sizeof(file_type)); 1227 1228 1228 1229 (void) sl_strlcpy (theFile->fullpath, tmpcat, PATH_MAX); 1229 theFile->check_ mask= sh_files_maskof(SH_LEVEL_READONLY);1230 theFile->check_flags = sh_files_maskof(SH_LEVEL_READONLY); 1230 1231 CLEAR_SH_FFLAG_REPORTED(theFile->file_reported); 1231 1232 theFile->attr_string = NULL; 1232 1233 theFile->link_path = NULL; 1233 1234 1234 sh_files_search_file(tmpcat, &class, &check_mask, &dummy); 1235 if ((check_mask & MODI_PREL) != 0) 1236 { 1237 theFile->check_mask |= MODI_PREL; 1238 } 1235 sh_files_search_file(tmpcat, &class, &check_flags, &dummy); 1236 if ((check_flags & MODI_PREL) != 0) 1237 MODI_SET(theFile->check_flags, MODI_PREL); 1239 1238 1240 1239 status = sh_unix_getinfo (ShDFLevel[SH_ERR_T_RO], … … 1303 1302 /* Running init. Report on files detected. 1304 1303 */ 1305 sh_ hash_pushdata(theFile, fileHash); /* no call to sh_error_handle */1304 sh_dbIO_data_write (theFile, fileHash); /* no call to sh_error_handle */ 1306 1305 SH_MUTEX_LOCK(mutex_thread_nolog); 1307 1306 sh_error_handle ((-1), FIL__, __LINE__, … … 2215 2214 } 2216 2215 2217 /* This variable is not used anywhere. It only exists2218 * to assign &dirlist to it, which keeps gcc from2219 * putting it into a register, and avoids the 'clobbered2220 * by longjmp' warning. And no, 'volatile' proved insufficient.2221 */2222 static void * sh_dummy_type = NULL;2223 2224 2225 2216 /* Return a newly allocated string naming the type of filesystem that the 2226 2217 file PATH, described by STATP, is on. 2227 2218 RELPATH is the file name relative to the current directory. 2228 2219 Return "unknown" if its filesystem type is unknown. */ 2220 2221 void * sh_dummy_2229_type; 2229 2222 2230 2223 static char * … … 2243 2236 FILE *mfp; 2244 2237 struct mntent *mnt; 2238 2239 /* Take the address to keep gcc from putting it into a register. 2240 * Avoids the 'clobbered by longjmp' warning. 2241 */ 2242 sh_dummy_2229_type = (void *) &type; 2245 2243 2246 2244 if (path == NULL || relpath == NULL) … … 2257 2255 return NULL; 2258 2256 } 2259 2260 /* Take the address to keep gcc from putting it into a register.2261 * Avoids the 'clobbered by longjmp' warning.2262 */2263 sh_dummy_type = (void*) &type;2264 2257 2265 2258 /* Find the entry with the same device number as STATP, and return
Note:
See TracChangeset
for help on using the changeset viewer.