{"action":"created","comment":{"url":"https://api.github.com/repos/systemd/systemd/pulls/comments/85252487","pull_request_review_id":5978672,"id":85252487,"diff_hunk":"@@ -2059,6 +2059,33 @@ static int apply_mount_namespace(Unit *u, const ExecContext *context,\n         return r;\n }\n \n+static int apply_working_directory(const ExecContext *context,\n+                                   const ExecParameters *params,\n+                                   const char *working_directory,\n+                                   const bool needs_mount_ns) {\n+\n+        if (params->flags & EXEC_APPLY_CHROOT) {\n+                if (!needs_mount_ns && context->root_directory)\n+                        if (chroot(context->root_directory) < 0)\n+                                return -errno;\n+\n+                if (chdir(working_directory) < 0 &&\n+                    !context->working_directory_missing_ok)\n+                        return -errno;\n+\n+        } else {\n+                const char *d;\n+\n+                d = strjoina(strempty(context->root_directory), \"/\",\n+                             strempty(working_directory));\n+                if (chdir(d) < 0 &&","path":"src/core/execute.c","position":null,"original_position":23,"commit_id":"e041fd54c1c34d61184d450786bf7f5762b0721c","original_commit_id":"fd316f462e6e8cfd7139ea1a4d96e7d54686ade2","user":{"login":"keszybz","id":349618,"avatar_url":"https://avatars.githubusercontent.com/u/349618?v=3","gravatar_id":"","url":"https://api.github.com/users/keszybz","html_url":"https://github.com/keszybz","followers_url":"https://api.github.com/users/keszybz/followers","following_url":"https://api.github.com/users/keszybz/following{/other_user}","gists_url":"https://api.github.com/users/keszybz/gists{/gist_id}","starred_url":"https://api.github.com/users/keszybz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keszybz/subscriptions","organizations_url":"https://api.github.com/users/keszybz/orgs","repos_url":"https://api.github.com/users/keszybz/repos","events_url":"https://api.github.com/users/keszybz/events{/privacy}","received_events_url":"https://api.github.com/users/keszybz/received_events","type":"User","site_admin":false},"body":"It would be nicy to move the `if (chdir…)` part outside of the conditional. It's the same in both.","created_at":"2016-10-27T01:28:17Z","updated_at":"2016-10-27T01:36:20Z","html_url":"https://github.com/systemd/systemd/pull/4485#discussion_r85252487","pull_request_url":"https://api.github.com/repos/systemd/systemd/pulls/4485","_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments/85252487"},"html":{"href":"https://github.com/systemd/systemd/pull/4485#discussion_r85252487"},"pull_request":{"href":"https://api.github.com/repos/systemd/systemd/pulls/4485"}}},"pull_request":{"url":"https://api.github.com/repos/systemd/systemd/pulls/4485","id":90821377,"html_url":"https://github.com/systemd/systemd/pull/4485","diff_url":"https://github.com/systemd/systemd/pull/4485.diff","patch_url":"https://github.com/systemd/systemd/pull/4485.patch","issue_url":"https://api.github.com/repos/systemd/systemd/issues/4485","number":4485,"state":"open","locked":false,"title":"core: improve mount namespace and working directory setup","user":{"login":"tixxdz","id":1549291,"avatar_url":"https://avatars.githubusercontent.com/u/1549291?v=3","gravatar_id":"","url":"https://api.github.com/users/tixxdz","html_url":"https://github.com/tixxdz","followers_url":"https://api.github.com/users/tixxdz/followers","following_url":"https://api.github.com/users/tixxdz/following{/other_user}","gists_url":"https://api.github.com/users/tixxdz/gists{/gist_id}","starred_url":"https://api.github.com/users/tixxdz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tixxdz/subscriptions","organizations_url":"https://api.github.com/users/tixxdz/orgs","repos_url":"https://api.github.com/users/tixxdz/repos","events_url":"https://api.github.com/users/tixxdz/events{/privacy}","received_events_url":"https://api.github.com/users/tixxdz/received_events","type":"User","site_admin":false},"body":"Minor changes into the direction of cleaning the setup of the service environment where we re-order the environment first then the sandbox security context after.","created_at":"2016-10-25T14:38:51Z","updated_at":"2016-10-27T01:36:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93901af820c7f2bf29a3edc2839ea186857f0874","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/systemd/systemd/pulls/4485/commits","review_comments_url":"https://api.github.com/repos/systemd/systemd/pulls/4485/comments","review_comment_url":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/4485/comments","statuses_url":"https://api.github.com/repos/systemd/systemd/statuses/e041fd54c1c34d61184d450786bf7f5762b0721c","head":{"label":"endocode:djalal/portable-branch-v1","ref":"djalal/portable-branch-v1","sha":"e041fd54c1c34d61184d450786bf7f5762b0721c","user":{"login":"endocode","id":4068543,"avatar_url":"https://avatars.githubusercontent.com/u/4068543?v=3","gravatar_id":"","url":"https://api.github.com/users/endocode","html_url":"https://github.com/endocode","followers_url":"https://api.github.com/users/endocode/followers","following_url":"https://api.github.com/users/endocode/following{/other_user}","gists_url":"https://api.github.com/users/endocode/gists{/gist_id}","starred_url":"https://api.github.com/users/endocode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endocode/subscriptions","organizations_url":"https://api.github.com/users/endocode/orgs","repos_url":"https://api.github.com/users/endocode/repos","events_url":"https://api.github.com/users/endocode/events{/privacy}","received_events_url":"https://api.github.com/users/endocode/received_events","type":"Organization","site_admin":false},"repo":{"id":36789448,"name":"systemd","full_name":"endocode/systemd","owner":{"login":"endocode","id":4068543,"avatar_url":"https://avatars.githubusercontent.com/u/4068543?v=3","gravatar_id":"","url":"https://api.github.com/users/endocode","html_url":"https://github.com/endocode","followers_url":"https://api.github.com/users/endocode/followers","following_url":"https://api.github.com/users/endocode/following{/other_user}","gists_url":"https://api.github.com/users/endocode/gists{/gist_id}","starred_url":"https://api.github.com/users/endocode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endocode/subscriptions","organizations_url":"https://api.github.com/users/endocode/orgs","repos_url":"https://api.github.com/users/endocode/repos","events_url":"https://api.github.com/users/endocode/events{/privacy}","received_events_url":"https://api.github.com/users/endocode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/endocode/systemd","description":"systemd upstream","fork":true,"url":"https://api.github.com/repos/endocode/systemd","forks_url":"https://api.github.com/repos/endocode/systemd/forks","keys_url":"https://api.github.com/repos/endocode/systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endocode/systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endocode/systemd/teams","hooks_url":"https://api.github.com/repos/endocode/systemd/hooks","issue_events_url":"https://api.github.com/repos/endocode/systemd/issues/events{/number}","events_url":"https://api.github.com/repos/endocode/systemd/events","assignees_url":"https://api.github.com/repos/endocode/systemd/assignees{/user}","branches_url":"https://api.github.com/repos/endocode/systemd/branches{/branch}","tags_url":"https://api.github.com/repos/endocode/systemd/tags","blobs_url":"https://api.github.com/repos/endocode/systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endocode/systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endocode/systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/endocode/systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endocode/systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/endocode/systemd/languages","stargazers_url":"https://api.github.com/repos/endocode/systemd/stargazers","contributors_url":"https://api.github.com/repos/endocode/systemd/contributors","subscribers_url":"https://api.github.com/repos/endocode/systemd/subscribers","subscription_url":"https://api.github.com/repos/endocode/systemd/subscription","commits_url":"https://api.github.com/repos/endocode/systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/endocode/systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/endocode/systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/endocode/systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/endocode/systemd/contents/{+path}","compare_url":"https://api.github.com/repos/endocode/systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endocode/systemd/merges","archive_url":"https://api.github.com/repos/endocode/systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endocode/systemd/downloads","issues_url":"https://api.github.com/repos/endocode/systemd/issues{/number}","pulls_url":"https://api.github.com/repos/endocode/systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/endocode/systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/endocode/systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endocode/systemd/labels{/name}","releases_url":"https://api.github.com/repos/endocode/systemd/releases{/id}","deployments_url":"https://api.github.com/repos/endocode/systemd/deployments","created_at":"2015-06-03T08:12:03Z","updated_at":"2016-01-13T17:22:24Z","pushed_at":"2016-10-25T18:11:40Z","git_url":"git://github.com/endocode/systemd.git","ssh_url":"git@github.com:endocode/systemd.git","clone_url":"https://github.com/endocode/systemd.git","svn_url":"https://github.com/endocode/systemd","homepage":"http://www.freedesktop.org/wiki/Software/systemd/","size":61787,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"systemd:master","ref":"master","sha":"6086d2daf370426259299e6ff9316ae51238969a","user":{"login":"systemd","id":1918868,"avatar_url":"https://avatars.githubusercontent.com/u/1918868?v=3","gravatar_id":"","url":"https://api.github.com/users/systemd","html_url":"https://github.com/systemd","followers_url":"https://api.github.com/users/systemd/followers","following_url":"https://api.github.com/users/systemd/following{/other_user}","gists_url":"https://api.github.com/users/systemd/gists{/gist_id}","starred_url":"https://api.github.com/users/systemd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemd/subscriptions","organizations_url":"https://api.github.com/users/systemd/orgs","repos_url":"https://api.github.com/users/systemd/repos","events_url":"https://api.github.com/users/systemd/events{/privacy}","received_events_url":"https://api.github.com/users/systemd/received_events","type":"Organization","site_admin":false},"repo":{"id":32873313,"name":"systemd","full_name":"systemd/systemd","owner":{"login":"systemd","id":1918868,"avatar_url":"https://avatars.githubusercontent.com/u/1918868?v=3","gravatar_id":"","url":"https://api.github.com/users/systemd","html_url":"https://github.com/systemd","followers_url":"https://api.github.com/users/systemd/followers","following_url":"https://api.github.com/users/systemd/following{/other_user}","gists_url":"https://api.github.com/users/systemd/gists{/gist_id}","starred_url":"https://api.github.com/users/systemd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systemd/subscriptions","organizations_url":"https://api.github.com/users/systemd/orgs","repos_url":"https://api.github.com/users/systemd/repos","events_url":"https://api.github.com/users/systemd/events{/privacy}","received_events_url":"https://api.github.com/users/systemd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/systemd/systemd","description":"systemd upstream","fork":false,"url":"https://api.github.com/repos/systemd/systemd","forks_url":"https://api.github.com/repos/systemd/systemd/forks","keys_url":"https://api.github.com/repos/systemd/systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/systemd/systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/systemd/systemd/teams","hooks_url":"https://api.github.com/repos/systemd/systemd/hooks","issue_events_url":"https://api.github.com/repos/systemd/systemd/issues/events{/number}","events_url":"https://api.github.com/repos/systemd/systemd/events","assignees_url":"https://api.github.com/repos/systemd/systemd/assignees{/user}","branches_url":"https://api.github.com/repos/systemd/systemd/branches{/branch}","tags_url":"https://api.github.com/repos/systemd/systemd/tags","blobs_url":"https://api.github.com/repos/systemd/systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/systemd/systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/systemd/systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/systemd/systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/systemd/systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/systemd/systemd/languages","stargazers_url":"https://api.github.com/repos/systemd/systemd/stargazers","contributors_url":"https://api.github.com/repos/systemd/systemd/contributors","subscribers_url":"https://api.github.com/repos/systemd/systemd/subscribers","subscription_url":"https://api.github.com/repos/systemd/systemd/subscription","commits_url":"https://api.github.com/repos/systemd/systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/systemd/systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/systemd/systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/systemd/systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/systemd/systemd/contents/{+path}","compare_url":"https://api.github.com/repos/systemd/systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/systemd/systemd/merges","archive_url":"https://api.github.com/repos/systemd/systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/systemd/systemd/downloads","issues_url":"https://api.github.com/repos/systemd/systemd/issues{/number}","pulls_url":"https://api.github.com/repos/systemd/systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/systemd/systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/systemd/systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/systemd/systemd/labels{/name}","releases_url":"https://api.github.com/repos/systemd/systemd/releases{/id}","deployments_url":"https://api.github.com/repos/systemd/systemd/deployments","created_at":"2015-03-25T15:27:27Z","updated_at":"2016-10-27T01:36:12Z","pushed_at":"2016-10-27T01:22:26Z","git_url":"git://github.com/systemd/systemd.git","ssh_url":"git@github.com:systemd/systemd.git","clone_url":"https://github.com/systemd/systemd.git","svn_url":"https://github.com/systemd/systemd","homepage":"http://www.freedesktop.org/wiki/Software/systemd/","size":76321,"stargazers_count":1429,"watchers_count":1429,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":603,"mirror_url":null,"open_issues_count":471,"forks":603,"open_issues":471,"watchers":1429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/4485"},"html":{"href":"https://github.com/systemd/systemd/pull/4485"},"issue":{"href":"https://api.github.com/repos/systemd/systemd/issues/4485"},"comments":{"href":"https://api.github.com/repos/systemd/systemd/issues/4485/comments"},"review_comments":{"href":"https://api.github.com/repos/systemd/systemd/pulls/4485/comments"},"review_comment":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/systemd/systemd/pulls/4485/commits"},"statuses":{"href":"https://api.github.com/repos/systemd/systemd/statuses/e041fd54c1c34d61184d450786bf7f5762b0721c"}}}}
{"actor":{"display_login":"keszybz"}}