-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Fix copy module to reset filesystem acls #51868
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansibot
added
WIP
This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.
affects_2.8
This issue/PR affects Ansible v2.8
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
needs_triage
Needs a first human triage before being processed.
python3
support:community
This issue/PR relates to code supported by the Ansible community.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
labels
Feb 7, 2019
mkrizek
force-pushed
the
copy-acls2
branch
3 times, most recently
from
February 11, 2019 11:02
d7b6538
to
fbe63ef
Compare
mkrizek
changed the title
[WIP] Fix copy module to reset filesystem acls 2
Fix copy module to reset filesystem acls 2
Feb 11, 2019
ansibot
added
core_review
In order to be merged, this PR must follow the core review workflow.
and removed
WIP
This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers.
labels
Feb 11, 2019
s-hertel
removed
the
needs_triage
Needs a first human triage before being processed.
label
Feb 12, 2019
ansibot
added
the
stale_ci
This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.
label
Feb 20, 2019
This was referenced Mar 22, 2019
mkrizek
changed the title
Fix copy module to reset filesystem acls 2
Fix copy module to reset filesystem acls
Mar 22, 2019
ansibot
added
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
core_review
In order to be merged, this PR must follow the core review workflow.
and removed
stale_ci
This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.
core_review
In order to be merged, this PR must follow the core review workflow.
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
labels
Mar 22, 2019
bcoca
requested changes
Mar 28, 2019
ansibot
removed
the
core_review
In order to be merged, this PR must follow the core review workflow.
label
Mar 28, 2019
ansibot
added
the
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
label
Mar 28, 2019
The controller's fixup_perms2 uses filesystem acls to make the temporary file for copy readable by an unprivileged become user. On Python3, the acls are then copied to the destination filename so we have to remove them from there. We can't remove them prior to the copy because we may not have permission to read the file if the acls are not present. We can't remove them in atomic_move() because the move function shouldn't know anything about controller features. We may want to generalize this into a helper function, though. Fixes ansible#44412 Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
mkrizek
commented
Apr 2, 2019
bcoca
approved these changes
Apr 3, 2019
ansibot
added
core_review
In order to be merged, this PR must follow the core review workflow.
and removed
needs_revision
This PR fails CI tests or a maintainer has requested a review/revision of the PR.
labels
Apr 3, 2019
mkrizek
added a commit
to mkrizek/ansible
that referenced
this pull request
Apr 3, 2019
The controller's fixup_perms2 uses filesystem acls to make the temporary file for copy readable by an unprivileged become user. On Python3, the acls are then copied to the destination filename so we have to remove them from there. We can't remove them prior to the copy because we may not have permission to read the file if the acls are not present. We can't remove them in atomic_move() because the move function shouldn't know anything about controller features. We may want to generalize this into a helper function, though. Fixes ansible#44412 Co-authored-by: Toshio Kuratomi <a.badger@gmail.com> (cherry picked from commit d15812f)
mkrizek
added a commit
to mkrizek/ansible
that referenced
this pull request
Apr 3, 2019
The controller's fixup_perms2 uses filesystem acls to make the temporary file for copy readable by an unprivileged become user. On Python3, the acls are then copied to the destination filename so we have to remove them from there. We can't remove them prior to the copy because we may not have permission to read the file if the acls are not present. We can't remove them in atomic_move() because the move function shouldn't know anything about controller features. We may want to generalize this into a helper function, though. Fixes ansible#44412 Co-authored-by: Toshio Kuratomi <a.badger@gmail.com> (cherry picked from commit d15812f)
mkrizek
added a commit
to mkrizek/ansible
that referenced
this pull request
Apr 3, 2019
The controller's fixup_perms2 uses filesystem acls to make the temporary file for copy readable by an unprivileged become user. On Python3, the acls are then copied to the destination filename so we have to remove them from there. We can't remove them prior to the copy because we may not have permission to read the file if the acls are not present. We can't remove them in atomic_move() because the move function shouldn't know anything about controller features. We may want to generalize this into a helper function, though. Fixes ansible#44412 Co-authored-by: Toshio Kuratomi <a.badger@gmail.com> (cherry picked from commit d15812f)
abadger
pushed a commit
that referenced
this pull request
Apr 4, 2019
The controller's fixup_perms2 uses filesystem acls to make the temporary file for copy readable by an unprivileged become user. On Python3, the acls are then copied to the destination filename so we have to remove them from there. We can't remove them prior to the copy because we may not have permission to read the file if the acls are not present. We can't remove them in atomic_move() because the move function shouldn't know anything about controller features. We may want to generalize this into a helper function, though. Fixes #44412 Co-authored-by: Toshio Kuratomi <a.badger@gmail.com> (cherry picked from commit d15812f)
abadger
pushed a commit
that referenced
this pull request
Apr 4, 2019
* Fix copy module to reset filesystem acls (#51868) The controller's fixup_perms2 uses filesystem acls to make the temporary file for copy readable by an unprivileged become user. On Python3, the acls are then copied to the destination filename so we have to remove them from there. We can't remove them prior to the copy because we may not have permission to read the file if the acls are not present. We can't remove them in atomic_move() because the move function shouldn't know anything about controller features. We may want to generalize this into a helper function, though. Fixes #44412 Co-authored-by: Toshio Kuratomi <a.badger@gmail.com> (cherry picked from commit d15812f) * Fix get_bin_path usage
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.8
This issue/PR affects Ansible v2.8
bug
This issue/PR relates to a bug.
core_review
In order to be merged, this PR must follow the core review workflow.
files
Files category
module
This issue/PR relates to a module.
python3
support:community
This issue/PR relates to code supported by the Ansible community.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Alternative to #50419 and #51296
The controller's fixup_perms2 uses filesystem acls to make the temporary
file for copy readable by an unprivileged become user. On Python3, the
acls are then copied to the destination filename so we have to remove
them from there.
We can't remove them prior to the copy because we may not have
permission to read the file if the acls are not present. We can't
remove them in atomic_move() because the move function shouldn't know
anything about controller features. We may want to generalize this into
a helper function, though.
Fixes #44412
Co-authored-by: Toshio Kuratomi a.badger@gmail.com
ISSUE TYPE
COMPONENT NAME
copy
assemble
template
ADDITIONAL INFORMATION
The below action plugins use
_transfer_file
andfixup_perms2()
too. However, the files that are transferred to the remote system are only kept in ansible temp dir and removed after they are used. Therefore it is not necessary to remove ACLs in those cases.