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

Current file permissions not preserved #41

Open
jheiss opened this issue Jul 9, 2013 · 1 comment
Open

Current file permissions not preserved #41

jheiss opened this issue Jul 9, 2013 · 1 comment
Labels

Comments

@jheiss
Copy link
Member

jheiss commented Jul 9, 2013

Reported by Raymond Barbiero via email:

Say that tpkg a writes a file to /home/t/etc/a
Say that tpkg b writes a file to /home/t/etc/b

Tpkg a specifies:
file_defaults:
posix:
owner: t
group: roleusers

Tpkg b specifies (or has no file_defaults):
file_defaults:

Tpkg a is installed first. Ownership of the /home/t and /home/t/etc are now set to t:roleusers
Tpkg b is installed second. Ownership of /home/t is now root:root and /home/t/etc is now owned by root:root

@jheiss
Copy link
Member Author

jheiss commented Jul 9, 2013

My comment back:

That's a bug. There's logic in the unpack method such that existing files and directories overwritten by a package install should be left with their previous permissions and ownership, unless the new package has specific permissions and ownership for that particular file.

I.e. the precedence for deciding what permissions to apply to a file being installed are:

  • Package has specific perms for that file
  • File already exists, use existing perms
  • Use file_defaults from package

You can look for the comment that starts with the line "Reset the permission/ownership of the conflicting files as how they were before." if you want to inspect the code that should be doing this.

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

No branches or pull requests

1 participant