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

Whitelist /etc/mtab #347

Merged
merged 2 commits into from
Sep 12, 2018
Merged

Conversation

priyawadhwa
Copy link
Collaborator

@priyawadhwa priyawadhwa commented Sep 11, 2018

While looking into #345, we were seeing the error:

Error: error building image: chmod /etc/mtab: operation not permitted

during extraction of amazonlinux:1. I looked into why kaniko couldn't
extract this file properly, and found that it already existed as a
symlink pointing to /proc/mounts, which returned an error when we tried
to run chmod on it.

Confusingly, in the image the /etc/mtab is a regular file, not a
symlink.

I can think of two ways to solve this problem:

  1. Whitelist /etc/mtab so that whatever already exists in the system
    is used
  2. Check if a regular file already exists, and hasn't been extracted yet,
    before extracting

I went with option 1 because for option 2 we'd have to keep a list of
all files that had been extracted in memory.

If anyone has a better idea, very open to suggestions!

While looking into GoogleContainerTools#345, we were seeing the error:

Error: error building image: chmod /etc/mtab: operation not permitted

during extraction of `amazonlinux:1`. I looked into why kaniko couldn't
extract this file properly, and found that it already existed as a
symlink pointing to /proc/mounts, which returned an error when we tried
to run chmod on it.

Confusingly, in the image the /etc/mtab is a regular file, not a
symlink.

I can think of two ways to solve this problem:
  1. Whitelist /etc/mtab so that whatever already exists in the system
  is used
  2. Check if a regular file already exists, and hasn't been extracted yet,
  before extracting

I went with option 1 because for option 2 we'd have to keep a list of
all files that had been extracted in memory.
@priyawadhwa priyawadhwa merged commit c814466 into GoogleContainerTools:master Sep 12, 2018
@priyawadhwa priyawadhwa deleted the amazon branch September 12, 2018 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants