{"action":"created","comment":{"url":"https://api.github.com/repos/trailofbits/osquery/pulls/comments/64275002","id":64275002,"diff_hunk":"@@ -0,0 +1,555 @@\n+/*\n+*  Copyright (c) 2014-present, Facebook, Inc.\n+*  All rights reserved.\n+*\n+*  This source code is licensed under the BSD-style license found in the\n+*  LICENSE file in the root directory of this source tree. An additional grant\n+*  of patent rights can be found in the PATENTS file in the same directory.\n+*\n+*/\n+\n+#include <AclAPI.h>\n+#include <io.h>\n+#include <sddl.h>\n+#include <ShlObj.h>\n+\n+#include <memory>\n+#include <regex>\n+#include <string>\n+#include <vector>\n+#include <sstream>\n+\n+#include <boost/filesystem.hpp>\n+#include <boost/optional.hpp>\n+\n+#include \"osquery/core/process.h\"\n+#include \"osquery/filesystem/fileops.h\"\n+\n+namespace fs = boost::filesystem;\n+\n+namespace osquery {\n+\n+#define CHMOD_READ    SYNCHRONIZE | READ_CONTROL | FILE_READ_ATTRIBUTES | FILE_READ_EA | FILE_READ_DATA\n+#define CHMOD_WRITE   FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_WRITE_DATA | FILE_APPEND_DATA | DELETE\n+#define CHMOD_EXECUTE FILE_EXECUTE \n+\n+using SidObject = std::unique_ptr<unsigned char>;\n+using AclObject = std::unique_ptr<unsigned char>;\n+\n+class WindowsFindFiles {\n+public:\n+  explicit WindowsFindFiles(fs::path path) : path_(path) {\n+    handle_ = ::FindFirstFileA(path.make_preferred().string().c_str(), &fd_);","path":"osquery/filesystem/windows/fileops.cpp","position":42,"original_position":42,"commit_id":"507fdb18689b6ed903a368401802ef53c0bbb969","original_commit_id":"507fdb18689b6ed903a368401802ef53c0bbb969","user":{"login":"artemdinaburg","id":1051838,"avatar_url":"https://avatars.githubusercontent.com/u/1051838?v=3","gravatar_id":"","url":"https://api.github.com/users/artemdinaburg","html_url":"https://github.com/artemdinaburg","followers_url":"https://api.github.com/users/artemdinaburg/followers","following_url":"https://api.github.com/users/artemdinaburg/following{/other_user}","gists_url":"https://api.github.com/users/artemdinaburg/gists{/gist_id}","starred_url":"https://api.github.com/users/artemdinaburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemdinaburg/subscriptions","organizations_url":"https://api.github.com/users/artemdinaburg/orgs","repos_url":"https://api.github.com/users/artemdinaburg/repos","events_url":"https://api.github.com/users/artemdinaburg/events{/privacy}","received_events_url":"https://api.github.com/users/artemdinaburg/received_events","type":"User","site_admin":false},"body":"I think this should use `path_` and not `path`, since `path_` should already be initialized via initializer list?","created_at":"2016-05-23T19:37:01Z","updated_at":"2016-05-23T19:37:01Z","html_url":"https://github.com/trailofbits/osquery/pull/1#discussion_r64275002","pull_request_url":"https://api.github.com/repos/trailofbits/osquery/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/trailofbits/osquery/pulls/comments/64275002"},"html":{"href":"https://github.com/trailofbits/osquery/pull/1#discussion_r64275002"},"pull_request":{"href":"https://api.github.com/repos/trailofbits/osquery/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/trailofbits/osquery/pulls/1","id":71104790,"html_url":"https://github.com/trailofbits/osquery/pull/1","diff_url":"https://github.com/trailofbits/osquery/pull/1.diff","patch_url":"https://github.com/trailofbits/osquery/pull/1.patch","issue_url":"https://api.github.com/repos/trailofbits/osquery/issues/1","number":1,"state":"open","locked":false,"title":"Filesystem abstractions/codebase and tests","user":{"login":"artemdinaburg","id":1051838,"avatar_url":"https://avatars.githubusercontent.com/u/1051838?v=3","gravatar_id":"","url":"https://api.github.com/users/artemdinaburg","html_url":"https://github.com/artemdinaburg","followers_url":"https://api.github.com/users/artemdinaburg/followers","following_url":"https://api.github.com/users/artemdinaburg/following{/other_user}","gists_url":"https://api.github.com/users/artemdinaburg/gists{/gist_id}","starred_url":"https://api.github.com/users/artemdinaburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemdinaburg/subscriptions","organizations_url":"https://api.github.com/users/artemdinaburg/orgs","repos_url":"https://api.github.com/users/artemdinaburg/repos","events_url":"https://api.github.com/users/artemdinaburg/events{/privacy}","received_events_url":"https://api.github.com/users/artemdinaburg/received_events","type":"User","site_admin":false},"body":"PR for internal code review.","created_at":"2016-05-23T19:13:16Z","updated_at":"2016-05-23T19:37:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4708e7461db654fe764f884c23a60f026f9a447","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/trailofbits/osquery/pulls/1/commits","review_comments_url":"https://api.github.com/repos/trailofbits/osquery/pulls/1/comments","review_comment_url":"https://api.github.com/repos/trailofbits/osquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trailofbits/osquery/issues/1/comments","statuses_url":"https://api.github.com/repos/trailofbits/osquery/statuses/507fdb18689b6ed903a368401802ef53c0bbb969","head":{"label":"trailofbits:filesystem-abstractions/codebase-and-tests","ref":"filesystem-abstractions/codebase-and-tests","sha":"507fdb18689b6ed903a368401802ef53c0bbb969","user":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"repo":{"id":54419021,"name":"osquery","full_name":"trailofbits/osquery","owner":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trailofbits/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/trailofbits/osquery","forks_url":"https://api.github.com/repos/trailofbits/osquery/forks","keys_url":"https://api.github.com/repos/trailofbits/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trailofbits/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trailofbits/osquery/teams","hooks_url":"https://api.github.com/repos/trailofbits/osquery/hooks","issue_events_url":"https://api.github.com/repos/trailofbits/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/trailofbits/osquery/events","assignees_url":"https://api.github.com/repos/trailofbits/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/trailofbits/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/trailofbits/osquery/tags","blobs_url":"https://api.github.com/repos/trailofbits/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trailofbits/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trailofbits/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/trailofbits/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trailofbits/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/trailofbits/osquery/languages","stargazers_url":"https://api.github.com/repos/trailofbits/osquery/stargazers","contributors_url":"https://api.github.com/repos/trailofbits/osquery/contributors","subscribers_url":"https://api.github.com/repos/trailofbits/osquery/subscribers","subscription_url":"https://api.github.com/repos/trailofbits/osquery/subscription","commits_url":"https://api.github.com/repos/trailofbits/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/trailofbits/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/trailofbits/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/trailofbits/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/trailofbits/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/trailofbits/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trailofbits/osquery/merges","archive_url":"https://api.github.com/repos/trailofbits/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trailofbits/osquery/downloads","issues_url":"https://api.github.com/repos/trailofbits/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/trailofbits/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/trailofbits/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/trailofbits/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trailofbits/osquery/labels{/name}","releases_url":"https://api.github.com/repos/trailofbits/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/trailofbits/osquery/deployments","created_at":"2016-03-21T20:06:09Z","updated_at":"2016-05-19T13:57:38Z","pushed_at":"2016-05-23T19:13:16Z","git_url":"git://github.com/trailofbits/osquery.git","ssh_url":"git@github.com:trailofbits/osquery.git","clone_url":"https://github.com/trailofbits/osquery.git","svn_url":"https://github.com/trailofbits/osquery","homepage":"https://osquery.io","size":8065,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"trailofbits:master","ref":"master","sha":"26ad131c382e27b97897eb09ad427710346f7c6f","user":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"repo":{"id":54419021,"name":"osquery","full_name":"trailofbits/osquery","owner":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trailofbits/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/trailofbits/osquery","forks_url":"https://api.github.com/repos/trailofbits/osquery/forks","keys_url":"https://api.github.com/repos/trailofbits/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trailofbits/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trailofbits/osquery/teams","hooks_url":"https://api.github.com/repos/trailofbits/osquery/hooks","issue_events_url":"https://api.github.com/repos/trailofbits/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/trailofbits/osquery/events","assignees_url":"https://api.github.com/repos/trailofbits/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/trailofbits/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/trailofbits/osquery/tags","blobs_url":"https://api.github.com/repos/trailofbits/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trailofbits/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trailofbits/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/trailofbits/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trailofbits/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/trailofbits/osquery/languages","stargazers_url":"https://api.github.com/repos/trailofbits/osquery/stargazers","contributors_url":"https://api.github.com/repos/trailofbits/osquery/contributors","subscribers_url":"https://api.github.com/repos/trailofbits/osquery/subscribers","subscription_url":"https://api.github.com/repos/trailofbits/osquery/subscription","commits_url":"https://api.github.com/repos/trailofbits/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/trailofbits/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/trailofbits/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/trailofbits/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/trailofbits/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/trailofbits/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trailofbits/osquery/merges","archive_url":"https://api.github.com/repos/trailofbits/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trailofbits/osquery/downloads","issues_url":"https://api.github.com/repos/trailofbits/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/trailofbits/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/trailofbits/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/trailofbits/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trailofbits/osquery/labels{/name}","releases_url":"https://api.github.com/repos/trailofbits/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/trailofbits/osquery/deployments","created_at":"2016-03-21T20:06:09Z","updated_at":"2016-05-19T13:57:38Z","pushed_at":"2016-05-23T19:13:16Z","git_url":"git://github.com/trailofbits/osquery.git","ssh_url":"git@github.com:trailofbits/osquery.git","clone_url":"https://github.com/trailofbits/osquery.git","svn_url":"https://github.com/trailofbits/osquery","homepage":"https://osquery.io","size":8065,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trailofbits/osquery/pulls/1"},"html":{"href":"https://github.com/trailofbits/osquery/pull/1"},"issue":{"href":"https://api.github.com/repos/trailofbits/osquery/issues/1"},"comments":{"href":"https://api.github.com/repos/trailofbits/osquery/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/trailofbits/osquery/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/trailofbits/osquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trailofbits/osquery/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/trailofbits/osquery/statuses/507fdb18689b6ed903a368401802ef53c0bbb969"}}}}
{"actor":{"display_login":"artemdinaburg"}}