{"action":"created","comment":{"url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments/99711349","pull_request_review_id":20394694,"id":99711349,"diff_hunk":"@@ -47,11 +47,28 @@ func newSandbox(b *sandboxBuilder) (*sandbox, error) {\n \t\t}\n \t}\n \n-\t// Create temporary user account\n-\tuser, err := system.CreateUser(homeFolder.Path(), b.engine.groups)\n-\tif err != nil {\n-\t\thomeFolder.Remove() // best-effort clean-up this is a fatal error\n-\t\treturn nil, fmt.Errorf(\"Failed to create temporary system user, error: %s\", err)\n+\tvar user *system.User\n+\tvar username string\n+\n+\tif b.engine.config.CreateUser {\n+\t\t// Create temporary user account\n+\t\tuser, err = system.CreateUser(homeFolder.Path(), b.engine.groups)\n+\t\tif err != nil {\n+\t\t\thomeFolder.Remove() // best-effort clean-up this is a fatal error\n+\t\t\treturn nil, fmt.Errorf(\"Failed to create temporary system user, error: %s\", err)\n+\t\t}\n+\t\tusername = user.Name()\n+\t} else {\n+\t\tvar curUser *system.User\n+\n+\t\tuser = nil\n+\n+\t\tcurUser, err = system.CurrentUser()\n+\t\tif err != nil {\n+\t\t\treturn nil, err","path":"engines/native/sandbox.go","position":27,"original_position":27,"commit_id":"fccddf3cb34226bc1bb3fb5199c60e0e4eb1c3fa","original_commit_id":"fccddf3cb34226bc1bb3fb5199c60e0e4eb1c3fa","user":{"login":"jonasfj","id":149732,"avatar_url":"https://avatars.githubusercontent.com/u/149732?v=3","gravatar_id":"","url":"https://api.github.com/users/jonasfj","html_url":"https://github.com/jonasfj","followers_url":"https://api.github.com/users/jonasfj/followers","following_url":"https://api.github.com/users/jonasfj/following{/other_user}","gists_url":"https://api.github.com/users/jonasfj/gists{/gist_id}","starred_url":"https://api.github.com/users/jonasfj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonasfj/subscriptions","organizations_url":"https://api.github.com/users/jonasfj/orgs","repos_url":"https://api.github.com/users/jonasfj/repos","events_url":"https://api.github.com/users/jonasfj/events{/privacy}","received_events_url":"https://api.github.com/users/jonasfj/received_events","type":"User","site_admin":false},"body":"Don't forget to clean up `homeFolder.Remove() // best-effort clean-up this is a fatal error` as in the error handling for if-branch.","created_at":"2017-02-06T23:24:59Z","updated_at":"2017-02-07T00:02:41Z","html_url":"https://github.com/taskcluster/taskcluster-worker/pull/157#discussion_r99711349","pull_request_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157","_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments/99711349"},"html":{"href":"https://github.com/taskcluster/taskcluster-worker/pull/157#discussion_r99711349"},"pull_request":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157"}}},"pull_request":{"url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157","id":104707341,"html_url":"https://github.com/taskcluster/taskcluster-worker/pull/157","diff_url":"https://github.com/taskcluster/taskcluster-worker/pull/157.diff","patch_url":"https://github.com/taskcluster/taskcluster-worker/pull/157.patch","issue_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/157","number":157,"state":"open","locked":false,"title":"Bug 1336585: do not create a user if CreateUser is false","user":{"login":"djmitche","id":28673,"avatar_url":"https://avatars.githubusercontent.com/u/28673?v=3","gravatar_id":"","url":"https://api.github.com/users/djmitche","html_url":"https://github.com/djmitche","followers_url":"https://api.github.com/users/djmitche/followers","following_url":"https://api.github.com/users/djmitche/following{/other_user}","gists_url":"https://api.github.com/users/djmitche/gists{/gist_id}","starred_url":"https://api.github.com/users/djmitche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmitche/subscriptions","organizations_url":"https://api.github.com/users/djmitche/orgs","repos_url":"https://api.github.com/users/djmitche/repos","events_url":"https://api.github.com/users/djmitche/events{/privacy}","received_events_url":"https://api.github.com/users/djmitche/received_events","type":"User","site_admin":false},"body":"This adds a new CreateUser method to the system.User struct.\r\n\r\nIf not creating a user, the engine avoids deleting the user or its home\r\ndirectory, or killing its processes.\r\n\r\n---\r\n\r\n@walac: this passes tests and so on, but it's not clear how good the test coverage is for this code.  So:\r\n\r\n1. Does this seem right?\r\n1. How can I test this better?\r\n1. What do you think about the \"TODO\" item in `resultset.go`?\r\n","created_at":"2017-02-05T17:32:33Z","updated_at":"2017-02-07T00:02:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c572c9e11b06a1a7918c40e8fec2e5af216182a","assignee":{"login":"djmitche","id":28673,"avatar_url":"https://avatars.githubusercontent.com/u/28673?v=3","gravatar_id":"","url":"https://api.github.com/users/djmitche","html_url":"https://github.com/djmitche","followers_url":"https://api.github.com/users/djmitche/followers","following_url":"https://api.github.com/users/djmitche/following{/other_user}","gists_url":"https://api.github.com/users/djmitche/gists{/gist_id}","starred_url":"https://api.github.com/users/djmitche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmitche/subscriptions","organizations_url":"https://api.github.com/users/djmitche/orgs","repos_url":"https://api.github.com/users/djmitche/repos","events_url":"https://api.github.com/users/djmitche/events{/privacy}","received_events_url":"https://api.github.com/users/djmitche/received_events","type":"User","site_admin":false},"assignees":[{"login":"djmitche","id":28673,"avatar_url":"https://avatars.githubusercontent.com/u/28673?v=3","gravatar_id":"","url":"https://api.github.com/users/djmitche","html_url":"https://github.com/djmitche","followers_url":"https://api.github.com/users/djmitche/followers","following_url":"https://api.github.com/users/djmitche/following{/other_user}","gists_url":"https://api.github.com/users/djmitche/gists{/gist_id}","starred_url":"https://api.github.com/users/djmitche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djmitche/subscriptions","organizations_url":"https://api.github.com/users/djmitche/orgs","repos_url":"https://api.github.com/users/djmitche/repos","events_url":"https://api.github.com/users/djmitche/events{/privacy}","received_events_url":"https://api.github.com/users/djmitche/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157/commits","review_comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157/comments","review_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/157/comments","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/fccddf3cb34226bc1bb3fb5199c60e0e4eb1c3fa","head":{"label":"taskcluster:bug1336585","ref":"bug1336585","sha":"fccddf3cb34226bc1bb3fb5199c60e0e4eb1c3fa","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":43515791,"name":"taskcluster-worker","full_name":"taskcluster/taskcluster-worker","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/taskcluster-worker","description":"Primary worker for TaskCluster","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-worker","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/deployments","created_at":"2015-10-01T19:15:39Z","updated_at":"2016-12-20T14:39:13Z","pushed_at":"2017-02-06T22:16:11Z","git_url":"git://github.com/taskcluster/taskcluster-worker.git","ssh_url":"git@github.com:taskcluster/taskcluster-worker.git","clone_url":"https://github.com/taskcluster/taskcluster-worker.git","svn_url":"https://github.com/taskcluster/taskcluster-worker","homepage":"https://godoc.org/github.com/taskcluster/taskcluster-worker","size":85106,"stargazers_count":9,"watchers_count":9,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":9,"default_branch":"master"}},"base":{"label":"taskcluster:master","ref":"master","sha":"14eee19dc5d7c6e8f300aaea1fe8227c5478a917","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":43515791,"name":"taskcluster-worker","full_name":"taskcluster/taskcluster-worker","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/taskcluster-worker","description":"Primary worker for TaskCluster","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-worker","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/taskcluster-worker/deployments","created_at":"2015-10-01T19:15:39Z","updated_at":"2016-12-20T14:39:13Z","pushed_at":"2017-02-06T22:16:11Z","git_url":"git://github.com/taskcluster/taskcluster-worker.git","ssh_url":"git@github.com:taskcluster/taskcluster-worker.git","clone_url":"https://github.com/taskcluster/taskcluster-worker.git","svn_url":"https://github.com/taskcluster/taskcluster-worker","homepage":"https://godoc.org/github.com/taskcluster/taskcluster-worker","size":85106,"stargazers_count":9,"watchers_count":9,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157"},"html":{"href":"https://github.com/taskcluster/taskcluster-worker/pull/157"},"issue":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/157"},"comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/taskcluster/taskcluster-worker/statuses/fccddf3cb34226bc1bb3fb5199c60e0e4eb1c3fa"}}}}
{"actor":{"display_login":"jonasfj"}}