{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/mig/pulls/comments/49733373","id":49733373,"diff_hunk":"@@ -102,6 +102,47 @@ func TestContentSearch(t *testing.T) {\n \t}\n }\n \n+func TestDecompressedContentSearch(t *testing.T) {\n+\tfor _, tp := range TESTDATA {\n+\t\tvar (\n+\t\t\tr run\n+\t\t\ts search\n+\t\t)\n+\t\tvar expectedfiles = []string{\"\"}\n+\t\tif tp.name != \"testfile5\" {","path":"modules/file/file_test.go","position":11,"original_position":11,"commit_id":"4ebcf4be432d4c19ee2390dfe0673d1b03fb91d3","original_commit_id":"4ebcf4be432d4c19ee2390dfe0673d1b03fb91d3","user":{"login":"jvehent","id":415617,"avatar_url":"https://avatars.githubusercontent.com/u/415617?v=3","gravatar_id":"","url":"https://api.github.com/users/jvehent","html_url":"https://github.com/jvehent","followers_url":"https://api.github.com/users/jvehent/followers","following_url":"https://api.github.com/users/jvehent/following{/other_user}","gists_url":"https://api.github.com/users/jvehent/gists{/gist_id}","starred_url":"https://api.github.com/users/jvehent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvehent/subscriptions","organizations_url":"https://api.github.com/users/jvehent/orgs","repos_url":"https://api.github.com/users/jvehent/repos","events_url":"https://api.github.com/users/jvehent/events{/privacy}","received_events_url":"https://api.github.com/users/jvehent/received_events","type":"User","site_admin":false},"body":"I would prefer to do the opposite here, and have a special case that resets `expectedfiles` to an empty array if `tp.name == \"testfile5\"`.\r\nA comment explaining that testfile5 is a corrupt gzip that should fail to decompress would be nice too.","created_at":"2016-01-14T14:43:39Z","updated_at":"2016-01-14T14:43:39Z","html_url":"https://github.com/mozilla/mig/pull/160#discussion_r49733373","pull_request_url":"https://api.github.com/repos/mozilla/mig/pulls/160","_links":{"self":{"href":"https://api.github.com/repos/mozilla/mig/pulls/comments/49733373"},"html":{"href":"https://github.com/mozilla/mig/pull/160#discussion_r49733373"},"pull_request":{"href":"https://api.github.com/repos/mozilla/mig/pulls/160"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/mig/pulls/160","id":54381664,"html_url":"https://github.com/mozilla/mig/pull/160","diff_url":"https://github.com/mozilla/mig/pull/160.diff","patch_url":"https://github.com/mozilla/mig/pull/160.patch","issue_url":"https://api.github.com/repos/mozilla/mig/issues/160","number":160,"state":"open","locked":false,"title":"[minor] Decompress files before content inspect, aims to fix #108","user":{"login":"therealkbhat","id":7105012,"avatar_url":"https://avatars.githubusercontent.com/u/7105012?v=3","gravatar_id":"","url":"https://api.github.com/users/therealkbhat","html_url":"https://github.com/therealkbhat","followers_url":"https://api.github.com/users/therealkbhat/followers","following_url":"https://api.github.com/users/therealkbhat/following{/other_user}","gists_url":"https://api.github.com/users/therealkbhat/gists{/gist_id}","starred_url":"https://api.github.com/users/therealkbhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealkbhat/subscriptions","organizations_url":"https://api.github.com/users/therealkbhat/orgs","repos_url":"https://api.github.com/users/therealkbhat/repos","events_url":"https://api.github.com/users/therealkbhat/events{/privacy}","received_events_url":"https://api.github.com/users/therealkbhat/received_events","type":"User","site_admin":false},"body":"Work in progress.\r\n\r\n`decompressFile` returns a file descriptor which gets passed to `checkContent` and `checkHash` from `evaluateFile`. Note that I haven't removed `file string` from those calls; it seemed less invasive to pass both the string as well as the file descriptor, especially since the string is used extensively in calls to `debugprint` and `storematch`.\r\n\r\nDoes leaving the fd open across multiple function calls (`checkContent`, all the `checkHash`s) lead to any problems?\r\n\r\nI haven't gotten to tests or doc changes yet; thought I'd get feedback on this approach first. I also still need to look at dealing with multiple files in a single zip.","created_at":"2015-12-22T15:32:37Z","updated_at":"2016-01-14T14:43:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b7c68c2a39bf2c7d0a08e137e4bc1c79d884671","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/mig/pulls/160/commits","review_comments_url":"https://api.github.com/repos/mozilla/mig/pulls/160/comments","review_comment_url":"https://api.github.com/repos/mozilla/mig/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/mig/issues/160/comments","statuses_url":"https://api.github.com/repos/mozilla/mig/statuses/4ebcf4be432d4c19ee2390dfe0673d1b03fb91d3","head":{"label":"therealkbhat:file-decompress","ref":"file-decompress","sha":"4ebcf4be432d4c19ee2390dfe0673d1b03fb91d3","user":{"login":"therealkbhat","id":7105012,"avatar_url":"https://avatars.githubusercontent.com/u/7105012?v=3","gravatar_id":"","url":"https://api.github.com/users/therealkbhat","html_url":"https://github.com/therealkbhat","followers_url":"https://api.github.com/users/therealkbhat/followers","following_url":"https://api.github.com/users/therealkbhat/following{/other_user}","gists_url":"https://api.github.com/users/therealkbhat/gists{/gist_id}","starred_url":"https://api.github.com/users/therealkbhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealkbhat/subscriptions","organizations_url":"https://api.github.com/users/therealkbhat/orgs","repos_url":"https://api.github.com/users/therealkbhat/repos","events_url":"https://api.github.com/users/therealkbhat/events{/privacy}","received_events_url":"https://api.github.com/users/therealkbhat/received_events","type":"User","site_admin":false},"repo":{"id":44231100,"name":"mig","full_name":"therealkbhat/mig","owner":{"login":"therealkbhat","id":7105012,"avatar_url":"https://avatars.githubusercontent.com/u/7105012?v=3","gravatar_id":"","url":"https://api.github.com/users/therealkbhat","html_url":"https://github.com/therealkbhat","followers_url":"https://api.github.com/users/therealkbhat/followers","following_url":"https://api.github.com/users/therealkbhat/following{/other_user}","gists_url":"https://api.github.com/users/therealkbhat/gists{/gist_id}","starred_url":"https://api.github.com/users/therealkbhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealkbhat/subscriptions","organizations_url":"https://api.github.com/users/therealkbhat/orgs","repos_url":"https://api.github.com/users/therealkbhat/repos","events_url":"https://api.github.com/users/therealkbhat/events{/privacy}","received_events_url":"https://api.github.com/users/therealkbhat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/therealkbhat/mig","description":"Distributed & real time digital forensics at the speed of the cloud","fork":true,"url":"https://api.github.com/repos/therealkbhat/mig","forks_url":"https://api.github.com/repos/therealkbhat/mig/forks","keys_url":"https://api.github.com/repos/therealkbhat/mig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/therealkbhat/mig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/therealkbhat/mig/teams","hooks_url":"https://api.github.com/repos/therealkbhat/mig/hooks","issue_events_url":"https://api.github.com/repos/therealkbhat/mig/issues/events{/number}","events_url":"https://api.github.com/repos/therealkbhat/mig/events","assignees_url":"https://api.github.com/repos/therealkbhat/mig/assignees{/user}","branches_url":"https://api.github.com/repos/therealkbhat/mig/branches{/branch}","tags_url":"https://api.github.com/repos/therealkbhat/mig/tags","blobs_url":"https://api.github.com/repos/therealkbhat/mig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/therealkbhat/mig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/therealkbhat/mig/git/refs{/sha}","trees_url":"https://api.github.com/repos/therealkbhat/mig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/therealkbhat/mig/statuses/{sha}","languages_url":"https://api.github.com/repos/therealkbhat/mig/languages","stargazers_url":"https://api.github.com/repos/therealkbhat/mig/stargazers","contributors_url":"https://api.github.com/repos/therealkbhat/mig/contributors","subscribers_url":"https://api.github.com/repos/therealkbhat/mig/subscribers","subscription_url":"https://api.github.com/repos/therealkbhat/mig/subscription","commits_url":"https://api.github.com/repos/therealkbhat/mig/commits{/sha}","git_commits_url":"https://api.github.com/repos/therealkbhat/mig/git/commits{/sha}","comments_url":"https://api.github.com/repos/therealkbhat/mig/comments{/number}","issue_comment_url":"https://api.github.com/repos/therealkbhat/mig/issues/comments{/number}","contents_url":"https://api.github.com/repos/therealkbhat/mig/contents/{+path}","compare_url":"https://api.github.com/repos/therealkbhat/mig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/therealkbhat/mig/merges","archive_url":"https://api.github.com/repos/therealkbhat/mig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/therealkbhat/mig/downloads","issues_url":"https://api.github.com/repos/therealkbhat/mig/issues{/number}","pulls_url":"https://api.github.com/repos/therealkbhat/mig/pulls{/number}","milestones_url":"https://api.github.com/repos/therealkbhat/mig/milestones{/number}","notifications_url":"https://api.github.com/repos/therealkbhat/mig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/therealkbhat/mig/labels{/name}","releases_url":"https://api.github.com/repos/therealkbhat/mig/releases{/id}","created_at":"2015-10-14T07:24:44Z","updated_at":"2016-01-14T11:15:30Z","pushed_at":"2016-01-14T11:15:29Z","git_url":"git://github.com/therealkbhat/mig.git","ssh_url":"git@github.com:therealkbhat/mig.git","clone_url":"https://github.com/therealkbhat/mig.git","svn_url":"https://github.com/therealkbhat/mig","homepage":"http://mig.mozilla.org/","size":17128,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"4273463652385ec70ef810ab153deaaaa9bafa54","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":12719968,"name":"mig","full_name":"mozilla/mig","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/mig","description":"Distributed & real time digital forensics at the speed of the cloud","fork":false,"url":"https://api.github.com/repos/mozilla/mig","forks_url":"https://api.github.com/repos/mozilla/mig/forks","keys_url":"https://api.github.com/repos/mozilla/mig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/mig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/mig/teams","hooks_url":"https://api.github.com/repos/mozilla/mig/hooks","issue_events_url":"https://api.github.com/repos/mozilla/mig/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/mig/events","assignees_url":"https://api.github.com/repos/mozilla/mig/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/mig/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/mig/tags","blobs_url":"https://api.github.com/repos/mozilla/mig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/mig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/mig/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/mig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/mig/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/mig/languages","stargazers_url":"https://api.github.com/repos/mozilla/mig/stargazers","contributors_url":"https://api.github.com/repos/mozilla/mig/contributors","subscribers_url":"https://api.github.com/repos/mozilla/mig/subscribers","subscription_url":"https://api.github.com/repos/mozilla/mig/subscription","commits_url":"https://api.github.com/repos/mozilla/mig/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/mig/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/mig/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/mig/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/mig/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/mig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/mig/merges","archive_url":"https://api.github.com/repos/mozilla/mig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/mig/downloads","issues_url":"https://api.github.com/repos/mozilla/mig/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/mig/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/mig/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/mig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/mig/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/mig/releases{/id}","created_at":"2013-09-10T04:04:40Z","updated_at":"2016-01-13T04:22:11Z","pushed_at":"2016-01-14T11:15:09Z","git_url":"git://github.com/mozilla/mig.git","ssh_url":"git@github.com:mozilla/mig.git","clone_url":"https://github.com/mozilla/mig.git","svn_url":"https://github.com/mozilla/mig","homepage":"http://mig.mozilla.org/","size":18502,"stargazers_count":648,"watchers_count":648,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":103,"mirror_url":null,"open_issues_count":41,"forks":103,"open_issues":41,"watchers":648,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/mig/pulls/160"},"html":{"href":"https://github.com/mozilla/mig/pull/160"},"issue":{"href":"https://api.github.com/repos/mozilla/mig/issues/160"},"comments":{"href":"https://api.github.com/repos/mozilla/mig/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/mig/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/mig/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/mig/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/mig/statuses/4ebcf4be432d4c19ee2390dfe0673d1b03fb91d3"}}}}