Skip to content
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

File ownership not considered when building chroots #2552

Closed
jshuping opened this issue Apr 12, 2017 · 1 comment
Closed

File ownership not considered when building chroots #2552

jshuping opened this issue Apr 12, 2017 · 1 comment

Comments

@jshuping
Copy link

Nomad version

Nomad v0.5.5

Operating system and Environment details

Ubuntu 16.04 on AWS us-east-1 c3.xlarge

Issue

Inside the buildChroot method, there are some file copy and directory creation operations,
which are not considering file/dir ownership, only file/dir permissions.

Reproduction steps

  1. Create file /etc/foo/bar.txt, with perms 0400, owned by user/group bob:bob
  2. mkdir /etc/bar, with perms 0550, owned by bob:bob
  3. Create and run any simple job using the 'exec' driver (so that buildChroot is called)
    3a. (When data_dir is on a separate filesystem from /): Inspect copied filesystem in alloc dir.
    See that /etc/foo/bar.txt has perms 0400 but is owned by root:root (expected bob:bob).
    See that /etc/bar has perms 0550 but is owned by root:root (expected bob:bob)
    3b. (When data_dir is on same filesystem as /): Inspect hardlinked filesystem in alloc dir.
    Remember that dirs cannot be hardlinked, nomad has to create them.
    See that /etc/bar has perms 0550 but is owned by root:root (expected bob:bob)

It would be nice to preserve owner:group on these items. Thanks!

@schmichael schmichael self-assigned this Apr 12, 2017
schmichael added a commit that referenced this issue Apr 12, 2017
Fixes #2552

Not needed when hardlinking. Only adds Linux support but other OS's may
be easy.
schmichael added a commit that referenced this issue Apr 17, 2017
Fixes #2552

Not needed when hardlinking. Only adds Linux support but other OS's may
be easy.
schmichael added a commit that referenced this issue Apr 19, 2017
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants