{"action":"created","comment":{"url":"https://api.github.com/repos/systemd/systemd/pulls/comments/73086969","id":73086969,"diff_hunk":"@@ -1254,24 +1254,38 @@ static int setup_resolv_conf(const char *dest) {\n         /* Fix resolv.conf, if possible */\n         where = prefix_roota(dest, \"/etc/resolv.conf\");\n \n+        if (access(\"/usr/lib/systemd/resolv.conf\", F_OK) >= 0) {\n+                /* resolved is enabled on the host. In this, case bind mount its static resolv.conf file into the\n+                 * container, so that the container can use the host's resolver. Given that network namespacing is\n+                 * disabled it's only natural of the container also uses the host's resolver. It also has the big\n+                 * advantage that the container will be able to follow the host's DNS server configuration changes\n+                 * transparently. */\n+\n+                if (mount(\"/usr/lib/systemd/resolv.conf\", where, NULL, MS_BIND, NULL) < 0)\n+                        log_warning_errno(errno, \"Failed to mount /etc/resolv.conf in the container, ignoring: %m\");\n+                else {\n+                        if (mount(NULL, where, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY|MS_NOSUID|MS_NODEV, NULL) < 0)\n+                                log_warning_errno(errno, \"Failed to remount /etc/resolv.conf read-only, ignoring: %m\");","path":"src/nspawn/nspawn.c","position":69,"original_position":15,"commit_id":"35adcb4215854b7b4d74be23dbb993580daaee21","original_commit_id":"955db874ca3bb9910b78077e49a8904b1adc417c","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":"I know this is unlikely, but wouldn't this be a big snafu, allowing the container to overwrite a file on the host? Seems like this should fail hard if remounting ro fails.","created_at":"2016-08-02T02:54:00Z","updated_at":"2016-08-02T02:54:00Z","html_url":"https://github.com/systemd/systemd/pull/3820#discussion_r73086969","pull_request_url":"https://api.github.com/repos/systemd/systemd/pulls/3820","_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments/73086969"},"html":{"href":"https://github.com/systemd/systemd/pull/3820#discussion_r73086969"},"pull_request":{"href":"https://api.github.com/repos/systemd/systemd/pulls/3820"}}},"pull_request":{"url":"https://api.github.com/repos/systemd/systemd/pulls/3820","id":79069746,"html_url":"https://github.com/systemd/systemd/pull/3820","diff_url":"https://github.com/systemd/systemd/pull/3820.diff","patch_url":"https://github.com/systemd/systemd/pull/3820.patch","issue_url":"https://api.github.com/repos/systemd/systemd/issues/3820","number":3820,"state":"open","locked":false,"title":"nspawn resolv.conf handling improvements, and inherit $TERM all the way through nspawn → console login","user":{"login":"poettering","id":2130732,"avatar_url":"https://avatars.githubusercontent.com/u/2130732?v=3","gravatar_id":"","url":"https://api.github.com/users/poettering","html_url":"https://github.com/poettering","followers_url":"https://api.github.com/users/poettering/followers","following_url":"https://api.github.com/users/poettering/following{/other_user}","gists_url":"https://api.github.com/users/poettering/gists{/gist_id}","starred_url":"https://api.github.com/users/poettering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poettering/subscriptions","organizations_url":"https://api.github.com/users/poettering/orgs","repos_url":"https://api.github.com/users/poettering/repos","events_url":"https://api.github.com/users/poettering/events{/privacy}","received_events_url":"https://api.github.com/users/poettering/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-27T18:02:23Z","updated_at":"2016-08-02T02:54:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf045875881340c6fc3071a6966517269a02a813","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/systemd/systemd/pulls/3820/commits","review_comments_url":"https://api.github.com/repos/systemd/systemd/pulls/3820/comments","review_comment_url":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/3820/comments","statuses_url":"https://api.github.com/repos/systemd/systemd/statuses/35adcb4215854b7b4d74be23dbb993580daaee21","head":{"label":"poettering:nspawn-resolvconf","ref":"nspawn-resolvconf","sha":"35adcb4215854b7b4d74be23dbb993580daaee21","user":{"login":"poettering","id":2130732,"avatar_url":"https://avatars.githubusercontent.com/u/2130732?v=3","gravatar_id":"","url":"https://api.github.com/users/poettering","html_url":"https://github.com/poettering","followers_url":"https://api.github.com/users/poettering/followers","following_url":"https://api.github.com/users/poettering/following{/other_user}","gists_url":"https://api.github.com/users/poettering/gists{/gist_id}","starred_url":"https://api.github.com/users/poettering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poettering/subscriptions","organizations_url":"https://api.github.com/users/poettering/orgs","repos_url":"https://api.github.com/users/poettering/repos","events_url":"https://api.github.com/users/poettering/events{/privacy}","received_events_url":"https://api.github.com/users/poettering/received_events","type":"User","site_admin":false},"repo":{"id":37097921,"name":"systemd","full_name":"poettering/systemd","owner":{"login":"poettering","id":2130732,"avatar_url":"https://avatars.githubusercontent.com/u/2130732?v=3","gravatar_id":"","url":"https://api.github.com/users/poettering","html_url":"https://github.com/poettering","followers_url":"https://api.github.com/users/poettering/followers","following_url":"https://api.github.com/users/poettering/following{/other_user}","gists_url":"https://api.github.com/users/poettering/gists{/gist_id}","starred_url":"https://api.github.com/users/poettering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poettering/subscriptions","organizations_url":"https://api.github.com/users/poettering/orgs","repos_url":"https://api.github.com/users/poettering/repos","events_url":"https://api.github.com/users/poettering/events{/privacy}","received_events_url":"https://api.github.com/users/poettering/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/poettering/systemd","description":"systemd upstream","fork":true,"url":"https://api.github.com/repos/poettering/systemd","forks_url":"https://api.github.com/repos/poettering/systemd/forks","keys_url":"https://api.github.com/repos/poettering/systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poettering/systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poettering/systemd/teams","hooks_url":"https://api.github.com/repos/poettering/systemd/hooks","issue_events_url":"https://api.github.com/repos/poettering/systemd/issues/events{/number}","events_url":"https://api.github.com/repos/poettering/systemd/events","assignees_url":"https://api.github.com/repos/poettering/systemd/assignees{/user}","branches_url":"https://api.github.com/repos/poettering/systemd/branches{/branch}","tags_url":"https://api.github.com/repos/poettering/systemd/tags","blobs_url":"https://api.github.com/repos/poettering/systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poettering/systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poettering/systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/poettering/systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poettering/systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/poettering/systemd/languages","stargazers_url":"https://api.github.com/repos/poettering/systemd/stargazers","contributors_url":"https://api.github.com/repos/poettering/systemd/contributors","subscribers_url":"https://api.github.com/repos/poettering/systemd/subscribers","subscription_url":"https://api.github.com/repos/poettering/systemd/subscription","commits_url":"https://api.github.com/repos/poettering/systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/poettering/systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/poettering/systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/poettering/systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/poettering/systemd/contents/{+path}","compare_url":"https://api.github.com/repos/poettering/systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poettering/systemd/merges","archive_url":"https://api.github.com/repos/poettering/systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poettering/systemd/downloads","issues_url":"https://api.github.com/repos/poettering/systemd/issues{/number}","pulls_url":"https://api.github.com/repos/poettering/systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/poettering/systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/poettering/systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poettering/systemd/labels{/name}","releases_url":"https://api.github.com/repos/poettering/systemd/releases{/id}","deployments_url":"https://api.github.com/repos/poettering/systemd/deployments","created_at":"2015-06-08T23:07:59Z","updated_at":"2016-05-12T18:29:14Z","pushed_at":"2016-07-27T18:01:13Z","git_url":"git://github.com/poettering/systemd.git","ssh_url":"git@github.com:poettering/systemd.git","clone_url":"https://github.com/poettering/systemd.git","svn_url":"https://github.com/poettering/systemd","homepage":"http://www.freedesktop.org/wiki/Software/systemd/","size":65191,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"systemd:master","ref":"master","sha":"b6b609dbc202e5645fc58e87b8a7d46426ee4bb7","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-08-02T01:28:13Z","pushed_at":"2016-08-01T15:39:28Z","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":79281,"stargazers_count":1229,"watchers_count":1229,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":520,"mirror_url":null,"open_issues_count":394,"forks":520,"open_issues":394,"watchers":1229,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/systemd/systemd/pulls/3820"},"html":{"href":"https://github.com/systemd/systemd/pull/3820"},"issue":{"href":"https://api.github.com/repos/systemd/systemd/issues/3820"},"comments":{"href":"https://api.github.com/repos/systemd/systemd/issues/3820/comments"},"review_comments":{"href":"https://api.github.com/repos/systemd/systemd/pulls/3820/comments"},"review_comment":{"href":"https://api.github.com/repos/systemd/systemd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/systemd/systemd/pulls/3820/commits"},"statuses":{"href":"https://api.github.com/repos/systemd/systemd/statuses/35adcb4215854b7b4d74be23dbb993580daaee21"}}}}
{"actor":{"display_login":"keszybz"}}