{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/osquery/pulls/comments/23652651","id":23652651,"diff_hunk":"@@ -147,6 +148,120 @@ Status listFilesInDirectory(const boost::filesystem::path& path,\n   }\n }\n \n+Status listDirectoriesInDirectory(const boost::filesystem::path& path,\n+                            std::vector<std::string>& results) {\n+  try {\n+    if (!boost::filesystem::exists(path)) {\n+      return Status(1, \"Directory not found\");\n+    }\n+\n+    if (!boost::filesystem::is_directory(path)) {\n+      return Status(1, \"Supplied path is not a directory\");\n+    }\n+\n+    boost::filesystem::directory_iterator begin_iter(path);\n+    boost::filesystem::directory_iterator end_iter;\n+    for (; begin_iter != end_iter; begin_iter++) {\n+      if (boost::filesystem::is_directory(begin_iter->path())) {\n+        results.push_back(begin_iter->path().string());\n+      }\n+    }\n+\n+    return Status(0, \"OK\");\n+  } catch (const boost::filesystem::filesystem_error& e) {\n+    return Status(1, e.what());\n+  }\n+}\n+\n+Status doFileListing(const boost::filesystem::path& fs_path, std::vector<std::string>& results, std::vector<std::string>& components){\n+  if(components[components.size()-1][0] == '*' && components[components.size()-1].length() == 1){\n+    std::vector<std::string> files;\n+    Status stat = listFilesInDirectory(fs_path.parent_path(), files);\n+    if(stat.getCode() != 0){return stat;}\n+    for(auto& file : files){\n+        results.push_back(file);\n+    }\n+    return Status(0, \"OK\");\n+  }\n+  //If we get here, that means we've reached the last component of the original path.\n+  //Check to make sure the path we've arrived at is valid at all.\n+  try{\n+    if(!boost::filesystem::exists(fs_path)){return Status(0, \"OK\");}\n+  }catch(boost::filesystem::filesystem_error error){\n+    VLOG(1) << \"Permission was denied to access: \" << fs_path.string();","path":"osquery/filesystem/filesystem.cpp","position":61,"original_position":61,"commit_id":"4c1dd51734382f2bba8cb10e96d3e197e0a6a832","original_commit_id":"4c1dd51734382f2bba8cb10e96d3e197e0a6a832","user":{"login":"theopolis","id":981645,"avatar_url":"https://avatars.githubusercontent.com/u/981645?v=3","gravatar_id":"","url":"https://api.github.com/users/theopolis","html_url":"https://github.com/theopolis","followers_url":"https://api.github.com/users/theopolis/followers","following_url":"https://api.github.com/users/theopolis/following{/other_user}","gists_url":"https://api.github.com/users/theopolis/gists{/gist_id}","starred_url":"https://api.github.com/users/theopolis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theopolis/subscriptions","organizations_url":"https://api.github.com/users/theopolis/orgs","repos_url":"https://api.github.com/users/theopolis/repos","events_url":"https://api.github.com/users/theopolis/events{/privacy}","received_events_url":"https://api.github.com/users/theopolis/received_events","type":"User","site_admin":false},"body":"This ends up being VERY VERY loud. I would recommend removing it or using `VLOG(3)`.","created_at":"2015-01-27T23:18:08Z","updated_at":"2015-01-27T23:18:08Z","html_url":"https://github.com/facebook/osquery/pull/674#discussion_r23652651","pull_request_url":"https://api.github.com/repos/facebook/osquery/pulls/674","_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments/23652651"},"html":{"href":"https://github.com/facebook/osquery/pull/674#discussion_r23652651"},"pull_request":{"href":"https://api.github.com/repos/facebook/osquery/pulls/674"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/674","id":28049042,"html_url":"https://github.com/facebook/osquery/pull/674","diff_url":"https://github.com/facebook/osquery/pull/674.diff","patch_url":"https://github.com/facebook/osquery/pull/674.patch","issue_url":"https://api.github.com/repos/facebook/osquery/issues/674","number":674,"state":"open","locked":false,"title":"Adding recursive directory traversal functionality","user":{"login":"jedi22","id":2386877,"avatar_url":"https://avatars.githubusercontent.com/u/2386877?v=3","gravatar_id":"","url":"https://api.github.com/users/jedi22","html_url":"https://github.com/jedi22","followers_url":"https://api.github.com/users/jedi22/followers","following_url":"https://api.github.com/users/jedi22/following{/other_user}","gists_url":"https://api.github.com/users/jedi22/gists{/gist_id}","starred_url":"https://api.github.com/users/jedi22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedi22/subscriptions","organizations_url":"https://api.github.com/users/jedi22/orgs","repos_url":"https://api.github.com/users/jedi22/repos","events_url":"https://api.github.com/users/jedi22/events{/privacy}","received_events_url":"https://api.github.com/users/jedi22/received_events","type":"User","site_admin":false},"body":"Working pull request for adding the ability to specify queries with wildcards in them for recursive traversal and wildcard matching.\r\n\r\n","created_at":"2015-01-26T18:34:42Z","updated_at":"2015-01-27T23:18:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9989d5dd11cccd6fa8b6d53ad5de314232662729","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/osquery/pulls/674/commits","review_comments_url":"https://api.github.com/repos/facebook/osquery/pulls/674/comments","review_comment_url":"https://api.github.com/repos/facebook/osquery/pulls/comments/{number}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/674/comments","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/4c1dd51734382f2bba8cb10e96d3e197e0a6a832","head":{"label":"jedi22:filesystem_wild","ref":"filesystem_wild","sha":"4c1dd51734382f2bba8cb10e96d3e197e0a6a832","user":{"login":"jedi22","id":2386877,"avatar_url":"https://avatars.githubusercontent.com/u/2386877?v=3","gravatar_id":"","url":"https://api.github.com/users/jedi22","html_url":"https://github.com/jedi22","followers_url":"https://api.github.com/users/jedi22/followers","following_url":"https://api.github.com/users/jedi22/following{/other_user}","gists_url":"https://api.github.com/users/jedi22/gists{/gist_id}","starred_url":"https://api.github.com/users/jedi22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedi22/subscriptions","organizations_url":"https://api.github.com/users/jedi22/orgs","repos_url":"https://api.github.com/users/jedi22/repos","events_url":"https://api.github.com/users/jedi22/events{/privacy}","received_events_url":"https://api.github.com/users/jedi22/received_events","type":"User","site_admin":false},"repo":{"id":29310726,"name":"osquery","full_name":"jedi22/osquery","owner":{"login":"jedi22","id":2386877,"avatar_url":"https://avatars.githubusercontent.com/u/2386877?v=3","gravatar_id":"","url":"https://api.github.com/users/jedi22","html_url":"https://github.com/jedi22","followers_url":"https://api.github.com/users/jedi22/followers","following_url":"https://api.github.com/users/jedi22/following{/other_user}","gists_url":"https://api.github.com/users/jedi22/gists{/gist_id}","starred_url":"https://api.github.com/users/jedi22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedi22/subscriptions","organizations_url":"https://api.github.com/users/jedi22/orgs","repos_url":"https://api.github.com/users/jedi22/repos","events_url":"https://api.github.com/users/jedi22/events{/privacy}","received_events_url":"https://api.github.com/users/jedi22/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jedi22/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/jedi22/osquery","forks_url":"https://api.github.com/repos/jedi22/osquery/forks","keys_url":"https://api.github.com/repos/jedi22/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jedi22/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jedi22/osquery/teams","hooks_url":"https://api.github.com/repos/jedi22/osquery/hooks","issue_events_url":"https://api.github.com/repos/jedi22/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/jedi22/osquery/events","assignees_url":"https://api.github.com/repos/jedi22/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/jedi22/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/jedi22/osquery/tags","blobs_url":"https://api.github.com/repos/jedi22/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jedi22/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jedi22/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/jedi22/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jedi22/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/jedi22/osquery/languages","stargazers_url":"https://api.github.com/repos/jedi22/osquery/stargazers","contributors_url":"https://api.github.com/repos/jedi22/osquery/contributors","subscribers_url":"https://api.github.com/repos/jedi22/osquery/subscribers","subscription_url":"https://api.github.com/repos/jedi22/osquery/subscription","commits_url":"https://api.github.com/repos/jedi22/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/jedi22/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/jedi22/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/jedi22/osquery/issues/comments/{number}","contents_url":"https://api.github.com/repos/jedi22/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/jedi22/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jedi22/osquery/merges","archive_url":"https://api.github.com/repos/jedi22/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jedi22/osquery/downloads","issues_url":"https://api.github.com/repos/jedi22/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/jedi22/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/jedi22/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/jedi22/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jedi22/osquery/labels{/name}","releases_url":"https://api.github.com/repos/jedi22/osquery/releases{/id}","created_at":"2015-01-15T18:09:35Z","updated_at":"2015-01-20T19:56:22Z","pushed_at":"2015-01-27T22:38:22Z","git_url":"git://github.com/jedi22/osquery.git","ssh_url":"git@github.com:jedi22/osquery.git","clone_url":"https://github.com/jedi22/osquery.git","svn_url":"https://github.com/jedi22/osquery","homepage":"http://osquery.io","size":4513,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"f4dd6ec12b829ff667ca58e2a37b6739adb37f35","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":22394357,"name":"osquery","full_name":"facebook/osquery","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":false,"url":"https://api.github.com/repos/facebook/osquery","forks_url":"https://api.github.com/repos/facebook/osquery/forks","keys_url":"https://api.github.com/repos/facebook/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/osquery/teams","hooks_url":"https://api.github.com/repos/facebook/osquery/hooks","issue_events_url":"https://api.github.com/repos/facebook/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/osquery/events","assignees_url":"https://api.github.com/repos/facebook/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/osquery/tags","blobs_url":"https://api.github.com/repos/facebook/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/osquery/languages","stargazers_url":"https://api.github.com/repos/facebook/osquery/stargazers","contributors_url":"https://api.github.com/repos/facebook/osquery/contributors","subscribers_url":"https://api.github.com/repos/facebook/osquery/subscribers","subscription_url":"https://api.github.com/repos/facebook/osquery/subscription","commits_url":"https://api.github.com/repos/facebook/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/osquery/issues/comments/{number}","contents_url":"https://api.github.com/repos/facebook/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/osquery/merges","archive_url":"https://api.github.com/repos/facebook/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/osquery/downloads","issues_url":"https://api.github.com/repos/facebook/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/osquery/labels{/name}","releases_url":"https://api.github.com/repos/facebook/osquery/releases{/id}","created_at":"2014-07-29T20:27:33Z","updated_at":"2015-01-27T16:02:05Z","pushed_at":"2015-01-27T01:05:10Z","git_url":"git://github.com/facebook/osquery.git","ssh_url":"git@github.com:facebook/osquery.git","clone_url":"https://github.com/facebook/osquery.git","svn_url":"https://github.com/facebook/osquery","homepage":"http://osquery.io","size":10648,"stargazers_count":3539,"watchers_count":3539,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":241,"mirror_url":null,"open_issues_count":24,"forks":241,"open_issues":24,"watchers":3539,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/674"},"html":{"href":"https://github.com/facebook/osquery/pull/674"},"issue":{"href":"https://api.github.com/repos/facebook/osquery/issues/674"},"comments":{"href":"https://api.github.com/repos/facebook/osquery/issues/674/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/osquery/pulls/674/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/facebook/osquery/pulls/674/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/osquery/statuses/4c1dd51734382f2bba8cb10e96d3e197e0a6a832"}}}}