Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OnAccessExcludePath fail if there is a subdirectory #1412

Open
tchernomax opened this issue Nov 27, 2024 · 1 comment
Open

OnAccessExcludePath fail if there is a subdirectory #1412

tchernomax opened this issue Nov 27, 2024 · 1 comment
Labels

Comments

@tchernomax
Copy link
Contributor

tchernomax commented Nov 27, 2024

Describe the bug

Imagine the following hierarchy:

/a/
  b/
    c/
  x/
OnAccessIncludePath /a
OnAccessExcludePath /a/b

clamonacc will first "register" /a and all it's subdirectory (b, b/c, x).
From what I understand clamonacc will have buckets:

  • /a
  • /a/b
  • /a/b/c
  • /a/x

Since #1314 it will call onas_ht_rm_hierarchy on all "bucket" matching /a/b:

  • /a/b → ok, (it will also delete /a/b/c)
  • /a/b/c → fail (this path is already deleted)

It is possible to bypass the problem by using OnAccessExcludePath ^/a/b$.

Off-topic note: OnAccessExcludePath regexp or not isn't "dynamic", what I mean is that if the exclude path isn't present at the clamonacc start, but is created afterward → the exclusion isn't taken into account (I don't know if it's explained somewhere in the documentation)

@micahsnyder
Copy link
Contributor

Am I correct in thinking this bug is only in the main branch right now (i.e. will only affect 1.5.0, unless we fix before the stable release)?

I haven't tested it yet. I missed triaging this when you first submitted it. What happens when it fails because the path is already deleted? Does clamonacc fail to load or just throw a warning or error message?

Good point about it not being dynamic. I agree it seems like the exclusion should be checked before each scan.

TBH I feel like the ExcludePath option should also be checked in the same way by clamonacc.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants