Skip to content

Commit

Permalink
fix: Handle directories/files passed with the -d flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
userwiths committed Jul 22, 2024
1 parent 8474e6a commit ca96f27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions clamscan/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,15 @@ int scanmanager(const struct optstruct *opts)
if ((opt = optget(opts, "database"))->active) {
while (opt) {
if (optget(opts, "fail-if-cvd-older-than")->enabled) {
if (LSTAT(opt->strarg, &sb) == -1) {
logg(LOGG_ERROR, "Can't access database directory/file: %s\n", opt->strarg);
ret = 2;
goto done;
}
if(!S_ISDIR(sb.st_mode) && !CLI_DBEXT_SIGNATURE(opt->strarg)) {
opt = opt->nextarg;
continue;
}
if (check_if_cvd_outdated(opt->strarg, optget(opts, "fail-if-cvd-older-than")->numarg) != CL_SUCCESS) {
ret = 2;
goto done;
Expand Down

0 comments on commit ca96f27

Please sign in to comment.