Closed (fixed)
Project:
Antivirus
Version:
7.x-1.x-dev
Component:
Antivirus Integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2012 at 16:34 UTC
Updated:
12 Jan 2013 at 15:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
kevin hankens commentedI was thinking something like this.
Comment #2
erikwebb commentedShould we be checking based on file size or maybe just created a list of "supported" stream wrappers (e.g. public:// and private://)?
Comment #3
kevin hankens commentedYeah, I'm not sure. We could possibly use hook_stream_wrappers() to generate a list of checkboxes that are configurable as "scannable streams." And have public and private be the default values.
Comment #4
erikwebb commentedHow about something like this? I haven't been able to test it unfortunately, but this is what I was thinking.
Comment #6
erikwebb commentedWe should also write a test to make sure Antivirus isn't failing on empty or remote files.
Comment #7
erikwebb commentedComment #8
kevin hankens commentedYeah, I think that's the right idea, though it's throwing a fatal for me. I think it's because file_stream_wrapper_get_instance_by_uri() is returning an object. I don't have time to work on it tonight, but I'll work on it in the morning if need be.
Thx!
Comment #9
erikwebb commentedComment #10
kevin hankens commentedIt looks like there's inconsistent handling of the $file->uri, in some cases (media 1.x) the uri is /tmp/xxxxx without a stream wrapper. This would allow it to bypass the scanner.
I reworked the patch in #7 a little bit. Let me know if this looks sane :)
Comment #11
erikwebb commentedLooks good to me. Were you able to test with an oembed:// stream?
Comment #12
kevin hankens commentedYeah, it works well with oembed now. Should I try and write a test for this too?
Comment #13
erikwebb commentedIf you don't mind, that'd be great. I'm sure this is a relatively common case that we need to account for.
Comment #14
kevin hankens commentedOk, give this a try. Testing for the absence of a remote file in the scanner targets is a little weird, but I think it's a legit test.
Comment #15
kevin hankens commentedComment #16
erikwebb commentedThanks!
http://drupalcode.org/project/antivirus.git/commit/8263f31