Skip to content

Only chown network files within container metadata #34224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

estesp
Copy link
Contributor

@estesp estesp commented Jul 23, 2017

If the user specifies a mountpath from the host, we should not be
attempting to chown files outside the daemon's metadata directory
(represented by daemon.repository at init time).

This forces users who want to use user namespaces to handle the
ownership needs of any external files mounted as network files
(/etc/resolv.conf, /etc/hosts, /etc/hostname) separately from the
daemon. In all other volume/bind mount situations we have taken this
same line--we don't chown host filesystem content.

Docker-DCO-1.1-Signed-off-by: Phil Estes estesp@linux.vnet.ibm.com

@thaJeztah my only concern here is change in behavior if anyone has relied on mounting network files from a host system location and gotten this automatic "chown" behavior. Something we have to consider I guess.

@thaJeztah
Copy link
Member

@estesp discussing with @vieux; and this LGTM; can you add a small test?

@vieux vieux assigned vieux and unassigned aaronlehmann Oct 26, 2017
@estesp estesp force-pushed the no-chown-nwfiles-outside-metadata branch from c02b1fe to 308f501 Compare October 31, 2017 22:58
@estesp
Copy link
Contributor Author

estesp commented Oct 31, 2017

Thanks @thaJeztah; test added!

If the user specifies a mountpath from the host, we should not be
attempting to chown files outside the daemon's metadata directory
(represented by `daemon.repository` at init time).

This forces users who want to use user namespaces to handle the
ownership needs of any external files mounted as network files
(/etc/resolv.conf, /etc/hosts, /etc/hostname) separately from the
daemon. In all other volume/bind mount situations we have taken this
same line--we don't chown host file content.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
@estesp estesp force-pushed the no-chown-nwfiles-outside-metadata branch from 308f501 to 42716dc Compare November 1, 2017 14:14
Copy link
Contributor

@vieux vieux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants