-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AVMaxFileSize config option #133
Conversation
@VicDeo, thanks for your PR! By analyzing the history of the files in this pull request, we identified @FCTURNER, @DeepDiver1975 and @vgezer to be potential reviewers. |
dc756ce
to
1258c87
Compare
@PVince81 please have a look |
$qb->expr()->eq('fc.storage', 'ss.numeric_id'), | ||
$qb->expr()->orX( | ||
$qb->expr()->like('ss.id', $qb->expr()->literal('local::%')), | ||
$qb->expr()->like('ss.id', $qb->expr()->literal('home::%')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated, but reminded me of a potential issue, raised as #137
Code looks good. @owncloud/qa can you help testing ? @VicDeo Any chance to add unit tests of some sorts ? That quite some complex logic there. For the docs change, please raise a ticket in the documentation repo. |
@VicDeo question: what if the virus signature overlaps with the retry-boundary, can it still be detected properly ? |
maybe the unit test could have its own dummy signature and have the mock stream receiver detect it (which simulates whatever clamd does) |
E.g. When Stream Length contains 3 chunks. And file has 7. if a signature is spread across chunks 2-3-4 - the answer is Hm. I've just came upon an idea to hide chunk size from UI and make it completely internal. |
@VicDeo, you are right (I was wrong), byteCount ist cleared to zero in initScanner(). Virus scanning works now as desired. I tested it with the following configuration:
Virus signature overlaps second and third chunk. Virus is only detected if second chunk is repeated after reinitialisation of stream (if block overlapping is implemented). Result: The user gets the info "Unsupported media Type", which is a confusing message. If the other bug, leading to this wrong message could not be fixed (see #125 (comment)), I would recommend to add a log entry in case of virus detection (for example before avirwrapper.php#L99). |
@ms270169 I can't do anything better on the antivirus side. 403 with message "Forbidden" is neither too much descriptive. :/ |
grr. It drive me nuts. All methods of Config mock return |
@VicDeo , maybe you have an idea how to better visualize the message. Because the information about a detected virus is inside the HTTP 415 response. If the message of the response would be shown, everything would be clear for the user...
|
I still have no idea why PHPUnit mocks return null for the second testcase. |
@PVince81 ready from my POV |
@VicDeo from what I see this was tested and only needs a code review, correct ? |
2f8f0b3
to
99736b4
Compare
The code looks good, great to have tests! @VicDeo I didn't find where "AVMaxFileSize" is covered / passed in the tests, mind pointing me there ? I guess it probably has another name |
@PVince81 Not covered. |
Ok, fine 👍 |
Any back-port plan for 9.0.x? In 9.0.6 I have the same issue described in #125 . |
@VicDeo I tested it on 9.0.6 and it works. I don't get anymore the log file filled. I tested also the reaction online trying to upload an EICAR file and it detects it and stops the upload. For me the fix can be applied in 9.0.6 |
Updated steps:
Expected: It detects the virus. |
@SergioBertolinSG |
Description
Changes in Docs:
Stream Length (bytes)
26214400
(25Mb) by default. Should be <= thanStreamMaxLength
ClamAV valueFile size limit, -1 means no limit (bytes)
-1
by default - prevent background scanner from checking large files (Has no effect while scanning newly uploaded files)To test:
/etc/clamd.conf
to e.g. 10M