File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 43
43
44
44
my $detectVuln = " $ENV {VULN_REGEX_DETECTOR_ROOT}/src/detect/detect-vuln.pl" ;
45
45
my $validateVuln = " $ENV {VULN_REGEX_DETECTOR_ROOT}/src/validate/validate-vuln.pl" ;
46
+ my $cacheClient = " $ENV {VULN_REGEX_DETECTOR_ROOT}/src/cache/client/cli/cache-client.js" ; # We don't need this to work.
46
47
47
48
for my $script ($detectVuln , $validateVuln ) {
48
49
if (not -x $script ) {
83
84
$useCache = 0;
84
85
}
85
86
87
+ # We can't use the cache if we have no client.
88
+ if (not -x $cacheClient ) {
89
+ &log (" Cannot use cache, could not find cacheClient $cacheClient " );
90
+ $useCache = 0;
91
+ }
92
+
86
93
# Query cache?
87
94
my $cacheResponse ;
88
95
my $cacheHit = 0;
@@ -207,8 +214,7 @@ sub queryCache {
207
214
" result" => $PATTERN_UNKNOWN ,
208
215
};
209
216
210
- my $cacheClient = " $ENV {VULN_REGEX_DETECTOR_ROOT}/src/cache/client/cli/cache-client.js" ;
211
- if (not -f $cacheClient ) {
217
+ if (not -x $cacheClient ) {
212
218
&log (" queryCache: Could not find client $cacheClient " );
213
219
return $unknownResponse ;
214
220
}
@@ -259,8 +265,7 @@ sub queryCache {
259
265
sub updateCache {
260
266
my ($checkRegexResponse ) = @_ ;
261
267
262
- my $cacheClient = " $ENV {VULN_REGEX_DETECTOR_ROOT}/src/cache/client/cache-client.js" ;
263
- if (not -f $cacheClient ) {
268
+ if (not -x $cacheClient ) {
264
269
&log (" updateCache: Could not find client $cacheClient " );
265
270
return ;
266
271
}
You can’t perform that action at this time.
0 commit comments