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

[master] Make file.manage_file permission, user and group atomic #65657

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

m-czernek
Copy link
Contributor

@m-czernek m-czernek commented Dec 1, 2023

What does this PR do?

In this PR, I tweak the internal behavior of file.manage_file to improve the file permission and owner consistency while the function is executing. See the linked PR for discussion of why this might be useful to users.

In the end, while modifying the code, I found this approach to be the simplest and cleanest; however, I am open to discussions and modifying the approach.

What issues does this PR fix or reference?

Fixes: #65651

Previous Behavior

When the module copied a file, the file temporarily used the 600 perms with the user of the current running process.

New Behavior

Currently, the module attempts to modify the basic file attributes as soon as the file is copied to minimize the risk of race conditions.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@m-czernek m-czernek requested a review from a team as a code owner December 1, 2023 10:25
@m-czernek m-czernek requested review from felippeb and removed request for a team December 1, 2023 10:25
Copy link

welcome bot commented Dec 1, 2023

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Make file.manage_file permission, user and group atomic [master] Make file.manage_file permission, user and group atomic Dec 1, 2023
@dwoz dwoz added this to the Argon v3008.0 milestone Dec 18, 2023
@m-czernek
Copy link
Contributor Author

m-czernek commented Feb 13, 2024

Ping @dwoz @felippeb, any chance for a review? :)

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

Successfully merging this pull request may close these issues.

[BUG][DISCUSSION] file.manage_file might cause race condition due to permission config
2 participants