Skip to content

Commit ca96f27

Browse files
committed
fix: Handle directories/files passed with the -d flag.
1 parent 8474e6a commit ca96f27

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

clamscan/manager.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,15 @@ int scanmanager(const struct optstruct *opts)
12511251
if ((opt = optget(opts, "database"))->active) {
12521252
while (opt) {
12531253
if (optget(opts, "fail-if-cvd-older-than")->enabled) {
1254+
if (LSTAT(opt->strarg, &sb) == -1) {
1255+
logg(LOGG_ERROR, "Can't access database directory/file: %s\n", opt->strarg);
1256+
ret = 2;
1257+
goto done;
1258+
}
1259+
if(!S_ISDIR(sb.st_mode) && !CLI_DBEXT_SIGNATURE(opt->strarg)) {
1260+
opt = opt->nextarg;
1261+
continue;
1262+
}
12541263
if (check_if_cvd_outdated(opt->strarg, optget(opts, "fail-if-cvd-older-than")->numarg) != CL_SUCCESS) {
12551264
ret = 2;
12561265
goto done;

0 commit comments

Comments
 (0)