Commit Graph

394 Commits (main)

Author SHA1 Message Date
Dan Puttick e20035e325 Fix description for ooxml files 2017-08-04 16:31:52 -04:00
Dan Puttick 17b453af20 Return 'no description' instead of empty string 2017-07-27 17:06:23 -04:00
Dan Puttick c1d3457562 Move writing to log from File to Groomer 2017-07-27 17:06:23 -04:00
Dan Puttick 05179a7272 Redundant description for ooxml files 2017-07-27 17:06:22 -04:00
Dan Puttick 37fc204b18 Fix regression with application mimetypes 2017-07-27 17:06:22 -04:00
Dan Puttick 51bfaa1ff5 Move should_copy back to edge of call graph 2017-07-27 17:06:22 -04:00
Dan Puttick 538f7acc04 Move filecheck config into a separate file 2017-07-27 17:06:22 -04:00
Dan Puttick c87f483015 Slightly refactor File.check() 2017-07-27 17:06:22 -04:00
Dan Puttick 60bd5362c1 Add normal word doc to file_catalog 2017-07-27 17:06:15 -04:00
Dan Puttick 00ac5da5f7 Move Example.svg from normal to dangerous 2017-07-24 16:29:34 -04:00
Dan Puttick f71eecbae1 Re-add the zoo to Travis build 2017-07-20 18:40:16 -04:00
Dan Puttick 159bc9cee2 Add __repr__s to File and KittenGroomerFileCheck 2017-07-20 18:40:16 -04:00
Dan Puttick 92d77e1a82 Revert change to magic.from_file 2017-07-20 18:40:16 -04:00
Dan Puttick c3fed019ab Fix travis build 2017-07-20 18:40:16 -04:00
Dan Puttick 4bc113cefa Open file and magic.read_buffer in helpers.py 2017-07-20 18:40:16 -04:00
Dan Puttick cc5d1e5117 Fix issue with hashing symlinks to directories 2017-07-20 18:40:16 -04:00
Dan Puttick 3eff10fbcd Unicode error check travis 2017-07-20 18:40:16 -04:00
Dan Puttick 4205d57dec Fix logging for errors and symlinks 2017-07-20 18:40:16 -04:00
Dan Puttick 9ad04da755 Move filecheck logging tests back into tests/
* Add tests/logging/ directory with sample files
2017-07-20 18:40:16 -04:00
Dan Puttick dee35a5331 Fix description string behavior
* Make description string property return a string instead of array
2017-07-20 18:40:16 -04:00
Dan Puttick fe82a5ac0d Change rest of lists in Config to tuples 2017-07-20 18:40:16 -04:00
Dan Puttick 5527cbeeb7 Add main() to logging test file 2017-07-20 18:40:16 -04:00
Raphaël Vinot 338bd5a018 Merge pull request #16 from dputtick/dev
Bug fixes, test file catalog, refactoring
2017-07-18 14:03:22 +02:00
Dan Puttick 35eb8ea8ab Fixups for PR #16
* ObjectPool winoffice files are now make_dangerous
* safe_copy now catches IOErrors only
* Use os.makedirs(exist_ok=True) instead of checking for existence in safe_copy
and create_metadata_file
* Added stubs for two tests related to safe_copy
2017-07-17 14:52:22 -04:00
Dan Puttick 0c35885f17 Prevent copying MacOS hidden files 2017-07-17 10:22:46 -04:00
Dan Puttick 5aaeac6f16 Refactor FileBase.extension 2017-07-17 10:10:21 -04:00
Dan Puttick fcbf2e6574 Add tests for force_ext and groomer 2017-07-17 09:17:20 -04:00
Dan Puttick 814f7b84a1 Temporarily disable 42.zip in travis build 2017-07-16 20:18:05 -04:00
Dan Puttick 9761d44eda Temporarily remove 42.zip from dangerous/
* When running the tests locally, difficult to unzip 42.zip. Also, there's
no need for such a complicated archivebomb example. We can prove the same
effectiveness against archivebombs with a file like archivebomb.zip
2017-07-16 18:42:23 -04:00
Dan Puttick 770b1da922 Add archivebomb.zip to tests/dangerous 2017-07-16 18:38:07 -04:00
Dan Puttick 270597586e Remove self.cur_file from filecheck 2017-07-16 18:36:22 -04:00
Dan Puttick a47a00d7a9 Fix bug in split_mimetype and add test 2017-07-16 14:25:16 -04:00
Dan Puttick 36c4493cd6 Fix handling of symlinks 2017-07-16 14:05:48 -04:00
Dan Puttick fabc2cf7c4 Move Travis-only test files to uncategorized 2017-07-14 22:03:56 -04:00
Dan Puttick 7363a16318 Remove calls to make_binary and make_unknown 2017-07-14 21:57:29 -04:00
Dan Puttick 41abe7e5d6 Prevent following arbitrarily nested symlinks 2017-07-14 17:52:21 -04:00
Dan Puttick d7280a8535 Add tests for make_dangerous and safe_copy 2017-07-14 17:37:30 -04:00
Dan Puttick b77451ae7a Description_string now only allows strings 2017-07-14 16:42:31 -04:00
Dan Puttick a2989cfbd3 Add tests for mimetypes 2017-07-14 16:40:26 -04:00
Dan Puttick 930b059ae1 Add tests for has_extension 2017-07-14 14:06:55 -04:00
Dan Puttick df97228a75 Fix symlink behavior in helpers.py 2017-07-13 17:36:43 -04:00
Dan Puttick 6a96d3f7a2 Add tests for helpers.py 2017-07-13 17:01:02 -04:00
Dan Puttick 14b9d71da8 Mock out GroomerLogger in test_filecheck 2017-07-13 17:00:41 -04:00
Dan Puttick d3576db35d Stub out new unit tests 2017-07-13 14:44:51 -04:00
Dan Puttick 27cbdc57bc Fix FileBase.make_dangerous filename editing
* make_dangerous should only modify the filename if the file
wasn't previously identified as dangerous
* add_description should only be called if a reason_string
is supplied
2017-07-13 12:55:26 -04:00
Dan Puttick e19064c83f Refactor FileBase to store props as attributes
* This is kind of a big refactoring - I realized that storing file
props in a dict was causing some subtle problems, and that just having
them as attributes makes things a lot more simple
* I considered making a separate FileProps object and nesting it
inside FileBase, but almost all FileBase methods concern manipulating
file props, so it didn't really make sense.
* Tests are almost passing with this commit, but need a few more changes
and fixes for full test coverage + all passing.
2017-07-12 17:58:39 -04:00
Dan Puttick f424be79cd Move KittenGroomerError to end of file 2017-07-11 15:48:40 -04:00
Dan Puttick 7b8b175a93 Fixup comments, add stubs for new tests 2017-07-11 15:48:40 -04:00
Dan Puttick 966c577ff8 Add uncategorized 2017-07-11 15:47:48 -04:00
Dan Puttick fed4f75cd7 Filecheck tests work with file catalog 2017-07-07 16:09:06 -04:00