Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Make usernamespaces work without sidecar process #385

Merged
merged 2 commits into from
Feb 19, 2015

Conversation

crosbymichael
Copy link
Contributor

VICTORY

After spending alot of time reading long strace's I finally found a way to get user namespaces with work with all of the standard code.

The big changes is trying to mknod a device, if you get an EPERM then bind mount it, done.

ping @mrunalp !!!!!

This updates the console handling to chown the console on creation to
the root user within the container.

This also moves the setup mounts from the userns sidecar process into
the main init processes by trying to mknod devices, if it fails on an
EPERM then bind mount the device from the host into the container for
use.  This prevents access issues when the sidecar process mknods the
device for the usernamespace returning an EPERM when writting to
dev/null.

This also adds some error handling for init processes and nsinit updates
with added flags for testing and other functions.

Signed-off-by: Michael Crosby <[email protected]>
@mrunalp
Copy link
Contributor

mrunalp commented Feb 18, 2015

Great, I got as far as figuring out that we needed to bind mount :)

return nil
}
// containers running in a user namespace are not allowed to mknod
// devices so we can just bind mount it from the host.
Copy link
Contributor

Choose a reason for hiding this comment

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

could we pass a host bind flag here instead of relying on EPERM?

@avagin
Copy link
Contributor

avagin commented Feb 18, 2015

Good job! Except two tiny comments, LGTM. Thanks.

@crosbymichael
Copy link
Contributor Author

@avagin updated

@avagin
Copy link
Contributor

avagin commented Feb 18, 2015

LGTM, thanks

@crosbymichael crosbymichael force-pushed the userns-updates branch 2 times, most recently from d36f2ac to 6d8d41e Compare February 18, 2015 23:37
Move the network setup back into the standard init even for user
namespaces now that mounts are fully supported and working.

Signed-off-by: Michael Crosby <[email protected]>
@mrunalp
Copy link
Contributor

mrunalp commented Feb 19, 2015

LGTM

mrunalp pushed a commit that referenced this pull request Feb 19, 2015
Make usernamespaces work without sidecar process
@mrunalp mrunalp merged commit d06a2da into docker-archive:api Feb 19, 2015
@crosbymichael crosbymichael deleted the userns-updates branch February 19, 2015 00:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants