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.recurse: Do not convert octal mode string to int #35309

Merged
merged 2 commits into from
Aug 9, 2016

Conversation

terminalmage
Copy link
Contributor

When we run file.makedirs_perms to create the dest directory, we pass
through the mode to file.check_perms. However, file.check_perms expects
an octal string, not an int. This causes the initial directory to be
chmod'ed to the wrong mode. When there are files in the source
directory, file.recurse will invoke the file.directory state to manage
files/dirs in that directory, and this ends up correcting the mode as we
simply pass the dir_mode to it. However, when there are only directories
in the source directory, this never happens and the incorrect mode
remains on the destination directory.

Fixes #34945.

@terminalmage terminalmage force-pushed the issue34945 branch 2 times, most recently from 6d06b43 to 46aef82 Compare August 9, 2016 17:54
When we run file.makedirs_perms to create the dest directory, we pass
through the mode to file.check_perms. However, file.check_perms expects
an octal string, not an int. This causes the initial directory to be
chmod'ed to the wrong mode. When there are files in the source
directory, file.recurse will invoke the file.directory state to manage
files/dirs in that directory, and this ends up correcting the mode as we
simply pass the dir_mode to it. However, when there are only directories
in the source directory, this never happens and the incorrect mode
remains on the destination directory.

Fixes saltstack#34945.
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.

None yet

2 participants