Skip to content

Commit

Permalink
fix: Allow clamd to start normally when a whitelist is present.
Browse files Browse the repository at this point in the history
The given functionality was introduced in the [following commit](e4fe665)
and after taking a look at the [cli_cvdverify](https://github.com/Cisco-Talos/clamav/blob/e4fe6654c1618bacf3bff9ed64c52615c8c53a97/libclamav/cvd.c#L530) function I believe it is meant to verify only CVDs.

That is, it throws an error when encountering a clear text (whitelist, `ign`,`.ign2`) file.
I mimicked the way the allowed extensions in the Database folder were handled, and excluded the 2 clear text extensions mentioned above.
This has locally allowed for the normal execution of `clamd`.
  • Loading branch information
userwiths committed Jul 12, 2024
1 parent 1d30588 commit 9e2aa35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libclamav/cvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ cl_error_t cl_cvdgetage(const char *path, time_t *age_seconds)
if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
continue;

if (!CLI_DBEXT(dent->d_name))
if (!CLI_DBEXT(dent->d_name) || CLI_DBEXT_IGNORE(dent->d_name))
continue;

if (ends_with_sep)
Expand Down
8 changes: 8 additions & 0 deletions libclamav/readdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ struct cli_matcher;
cli_strbcasestr(ext, ".ign") || \
cli_strbcasestr(ext, ".ign2") || \
cli_strbcasestr(ext, ".imp"))
#define CLI_DBEXT_IGNORE(ext) \
( \
cli_strbcasestr(ext, ".ign") || \
cli_strbcasestr(ext, ".ign2"))
#else
#define CLI_DBEXT(ext) \
( \
Expand Down Expand Up @@ -120,6 +124,10 @@ struct cli_matcher;
cli_strbcasestr(ext, ".ign") || \
cli_strbcasestr(ext, ".ign2") || \
cli_strbcasestr(ext, ".imp"))
#define CLI_DBEXT_IGNORE(ext) \
( \
cli_strbcasestr(ext, ".ign") || \
cli_strbcasestr(ext, ".ign2"))
#endif

char *cli_virname(const char *virname, unsigned int official);
Expand Down

0 comments on commit 9e2aa35

Please sign in to comment.