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 provisioner changes permissions of parent directory when uploading directory #16

Open
ghost opened this issue Mar 19, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 19, 2021

This issue was originally opened by @GeorgFleig as hashicorp/packer#5955. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


When I use the file provisioner to upload files into a Docker container in a folder not owned by root, the permissions of the parent folder of the destination are changed.

Example:
before copy

    docker: drwxr-xr-x 2 build build 4096 Feb 28 14:57 .
    docker: drwxr-xr-x 1 root  root  4096 Feb 28 14:57 ..
    docker: -rw-r--r-- 1 build build  220 May 15  2017 .bash_logout
    docker: -rw-r--r-- 1 build build 3526 May 15  2017 .bashrc
    docker: -rw-r--r-- 1 build build  675 May 15  2017 .profile

after copy

    docker: drwxr-xr-x 2 root build 4096 Feb 28 14:57 .
    docker: drwxr-xr-x 1 root root  4096 Feb 28 14:57 ..
    docker: -rw-r--r-- 1 root build  220 May 15  2017 .bash_logout
    docker: -rw-r--r-- 1 root build 3526 May 15  2017 .bashrc
    docker: -rw-r--r-- 1 root build  675 May 15  2017 .profile
    docker: -rw-r--r-- 1 root build  538 Feb 28 10:20 file1.json
    docker: -rwxr-xr-x 1 root build 2704 Feb 28 12:23 file1.json

The owner of the parent folder /home/build is changed from build to root.

This happens when I copy a folder or the contents of a folder into that target. When I copy only a single file, the new file is owned by root:root as expected while all other permissions stay untouched.

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

No branches or pull requests

1 participant