{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/63248941","id":63248941,"diff_hunk":"@@ -142,13 +142,40 @@ func (daemon *Daemon) generateSecurityOpt(ipcMode containertypes.IpcMode, pidMod\n \tif ipcMode.IsHost() || pidMode.IsHost() {\n \t\treturn label.DisableSecOpt(), nil\n \t}\n-\tif ipcContainer := ipcMode.Container(); ipcContainer != \"\" {\n+\n+\tvar ipcLabel []string\n+\tvar pidLabel []string\n+\tipcContainer := ipcMode.Container()\n+\tpidContainer := pidMode.Container()\n+\tif ipcContainer != \"\" {\n \t\tc, err := daemon.GetContainer(ipcContainer)\n \t\tif err != nil {\n \t\t\treturn nil, err\n \t\t}\n+\t\tipcLabel = label.DupSecOpt(c.ProcessLabel)\n+\t\tif pidContainer == \"\" {\n+\t\t\treturn ipcLabel, err\n+\t\t}\n+\t}\n+\tif pidContainer != \"\" {\n+\t\tc, err := daemon.GetContainer(pidContainer)\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n \n-\t\treturn label.DupSecOpt(c.ProcessLabel), nil\n+\t\tpidLabel = label.DupSecOpt(c.ProcessLabel)\n+\t\tif ipcContainer == \"\" {\n+\t\t\treturn pidLabel, err\n+\t\t}\n+\t}\n+\n+\tif pidLabel != nil && ipcLabel != nil {\n+\t\tfor i := 0; i < len(pidLabel); i++ {\n+\t\t\tif pidLabel[i] != ipcLabel[i] {","path":"daemon/create.go","position":35,"original_position":35,"commit_id":"4772a40138e8f88e77f04049c1c2dc4865508dc7","original_commit_id":"4772a40138e8f88e77f04049c1c2dc4865508dc7","user":{"login":"mlaventure","id":16065150,"avatar_url":"https://avatars.githubusercontent.com/u/16065150?v=3","gravatar_id":"","url":"https://api.github.com/users/mlaventure","html_url":"https://github.com/mlaventure","followers_url":"https://api.github.com/users/mlaventure/followers","following_url":"https://api.github.com/users/mlaventure/following{/other_user}","gists_url":"https://api.github.com/users/mlaventure/gists{/gist_id}","starred_url":"https://api.github.com/users/mlaventure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlaventure/subscriptions","organizations_url":"https://api.github.com/users/mlaventure/orgs","repos_url":"https://api.github.com/users/mlaventure/repos","events_url":"https://api.github.com/users/mlaventure/events{/privacy}","received_events_url":"https://api.github.com/users/mlaventure/received_events","type":"User","site_admin":false},"body":"So we can't have a scenario where\r\n```\r\nipcLabel[0] = \"label1\" ; ipcLabel[1] = \"label2\"\r\npidLabel[0] = \"label2\" ; pidLabel[1] = \"label1\"\r\n```\r\n?","created_at":"2016-05-13T20:48:00Z","updated_at":"2016-05-13T20:48:00Z","html_url":"https://github.com/docker/docker/pull/22481#discussion_r63248941","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/22481","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/63248941"},"html":{"href":"https://github.com/docker/docker/pull/22481#discussion_r63248941"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/22481"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/22481","id":68749678,"html_url":"https://github.com/docker/docker/pull/22481","diff_url":"https://github.com/docker/docker/pull/22481.diff","patch_url":"https://github.com/docker/docker/pull/22481.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/22481","number":22481,"state":"open","locked":false,"title":"Add support for --pid=container:<id>","user":{"login":"mrunalp","id":53798,"avatar_url":"https://avatars.githubusercontent.com/u/53798?v=3","gravatar_id":"","url":"https://api.github.com/users/mrunalp","html_url":"https://github.com/mrunalp","followers_url":"https://api.github.com/users/mrunalp/followers","following_url":"https://api.github.com/users/mrunalp/following{/other_user}","gists_url":"https://api.github.com/users/mrunalp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrunalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrunalp/subscriptions","organizations_url":"https://api.github.com/users/mrunalp/orgs","repos_url":"https://api.github.com/users/mrunalp/repos","events_url":"https://api.github.com/users/mrunalp/events{/privacy}","received_events_url":"https://api.github.com/users/mrunalp/received_events","type":"User","site_admin":false},"body":"This is for https://github.com/docker/docker/issues/22479\r\n\r\nI will take out the engine-api code once https://github.com/docker/engine-api/pull/218 is merged.\r\n\r\n\r\nSigned-off-by: Mrunal Patel <mrunalp@gmail.com>","created_at":"2016-05-03T18:11:40Z","updated_at":"2016-05-13T20:48:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b55bd40c6a436988918c723273fe645af08b2b8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/22481/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/22481/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/22481/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/4772a40138e8f88e77f04049c1c2dc4865508dc7","head":{"label":"mrunalp:pid_container","ref":"pid_container","sha":"4772a40138e8f88e77f04049c1c2dc4865508dc7","user":{"login":"mrunalp","id":53798,"avatar_url":"https://avatars.githubusercontent.com/u/53798?v=3","gravatar_id":"","url":"https://api.github.com/users/mrunalp","html_url":"https://github.com/mrunalp","followers_url":"https://api.github.com/users/mrunalp/followers","following_url":"https://api.github.com/users/mrunalp/following{/other_user}","gists_url":"https://api.github.com/users/mrunalp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrunalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrunalp/subscriptions","organizations_url":"https://api.github.com/users/mrunalp/orgs","repos_url":"https://api.github.com/users/mrunalp/repos","events_url":"https://api.github.com/users/mrunalp/events{/privacy}","received_events_url":"https://api.github.com/users/mrunalp/received_events","type":"User","site_admin":false},"repo":{"id":14507301,"name":"docker","full_name":"mrunalp/docker","owner":{"login":"mrunalp","id":53798,"avatar_url":"https://avatars.githubusercontent.com/u/53798?v=3","gravatar_id":"","url":"https://api.github.com/users/mrunalp","html_url":"https://github.com/mrunalp","followers_url":"https://api.github.com/users/mrunalp/followers","following_url":"https://api.github.com/users/mrunalp/following{/other_user}","gists_url":"https://api.github.com/users/mrunalp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrunalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrunalp/subscriptions","organizations_url":"https://api.github.com/users/mrunalp/orgs","repos_url":"https://api.github.com/users/mrunalp/repos","events_url":"https://api.github.com/users/mrunalp/events{/privacy}","received_events_url":"https://api.github.com/users/mrunalp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrunalp/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/mrunalp/docker","forks_url":"https://api.github.com/repos/mrunalp/docker/forks","keys_url":"https://api.github.com/repos/mrunalp/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrunalp/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrunalp/docker/teams","hooks_url":"https://api.github.com/repos/mrunalp/docker/hooks","issue_events_url":"https://api.github.com/repos/mrunalp/docker/issues/events{/number}","events_url":"https://api.github.com/repos/mrunalp/docker/events","assignees_url":"https://api.github.com/repos/mrunalp/docker/assignees{/user}","branches_url":"https://api.github.com/repos/mrunalp/docker/branches{/branch}","tags_url":"https://api.github.com/repos/mrunalp/docker/tags","blobs_url":"https://api.github.com/repos/mrunalp/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrunalp/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrunalp/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrunalp/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrunalp/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/mrunalp/docker/languages","stargazers_url":"https://api.github.com/repos/mrunalp/docker/stargazers","contributors_url":"https://api.github.com/repos/mrunalp/docker/contributors","subscribers_url":"https://api.github.com/repos/mrunalp/docker/subscribers","subscription_url":"https://api.github.com/repos/mrunalp/docker/subscription","commits_url":"https://api.github.com/repos/mrunalp/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrunalp/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrunalp/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrunalp/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrunalp/docker/contents/{+path}","compare_url":"https://api.github.com/repos/mrunalp/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrunalp/docker/merges","archive_url":"https://api.github.com/repos/mrunalp/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrunalp/docker/downloads","issues_url":"https://api.github.com/repos/mrunalp/docker/issues{/number}","pulls_url":"https://api.github.com/repos/mrunalp/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/mrunalp/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/mrunalp/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrunalp/docker/labels{/name}","releases_url":"https://api.github.com/repos/mrunalp/docker/releases{/id}","deployments_url":"https://api.github.com/repos/mrunalp/docker/deployments","created_at":"2013-11-18T22:30:36Z","updated_at":"2014-07-24T21:22:31Z","pushed_at":"2016-05-13T18:48:52Z","git_url":"git://github.com/mrunalp/docker.git","ssh_url":"git@github.com:mrunalp/docker.git","clone_url":"https://github.com/mrunalp/docker.git","svn_url":"https://github.com/mrunalp/docker","homepage":"http://www.docker.io","size":89969,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"docker:master","ref":"master","sha":"a213a446d7828c54e9ce104b38e1adfd4827871e","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","deployments_url":"https://api.github.com/repos/docker/docker/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2016-05-13T20:46:23Z","pushed_at":"2016-05-13T19:41:56Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":194503,"stargazers_count":31182,"watchers_count":31182,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8874,"mirror_url":null,"open_issues_count":1560,"forks":8874,"open_issues":1560,"watchers":31182,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/22481"},"html":{"href":"https://github.com/docker/docker/pull/22481"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/22481"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/22481/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/22481/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/22481/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/4772a40138e8f88e77f04049c1c2dc4865508dc7"}}}}