@@ -136,7 +136,7 @@ struct pfdata {
136
136
probe_ctx * ctx ;
137
137
};
138
138
139
- static int process_file (const char * prefix , const char * path , const char * filename , void * arg , oval_schema_version_t over )
139
+ static int process_file (const char * prefix , const char * path , const char * filename , void * arg , oval_schema_version_t over , struct oscap_list * blocked_paths )
140
140
{
141
141
struct pfdata * pfd = (struct pfdata * ) arg ;
142
142
int ret = 0 , path_len , filename_len ;
@@ -170,6 +170,10 @@ static int process_file(const char *prefix, const char *path, const char *filena
170
170
}
171
171
memcpy (whole_path + path_len , filename , filename_len + 1 );
172
172
173
+ if (probe_path_is_blocked (whole_path , blocked_paths )) {
174
+ goto cleanup ;
175
+ }
176
+
173
177
/*
174
178
* If stat() fails, don't report an error and just skip the file.
175
179
* This is an expected situation, because the fts_*() functions
@@ -294,7 +298,7 @@ int textfilecontent_probe_main(probe_ctx *ctx, void *arg)
294
298
if (ofts_ent -> fts_info == FTS_F
295
299
|| ofts_ent -> fts_info == FTS_SL ) {
296
300
// todo: handle return code
297
- process_file (prefix , ofts_ent -> path , ofts_ent -> file , & pfd , over );
301
+ process_file (prefix , ofts_ent -> path , ofts_ent -> file , & pfd , over , ctx -> blocked_paths );
298
302
}
299
303
oval_ftsent_free (ofts_ent );
300
304
}
0 commit comments