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

Honor umask in calculating effective mode #622

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Conversation

ericwb
Copy link
Contributor

@ericwb ericwb commented Oct 3, 2024

Two Python loose permission rules will return results when a function is used with a default permission mode that is considered risky.

However, these rules were not accounting for the umask that is typically set in the operating system and Python honors when calculating the effective mode.

This change applies an assumed umask of 0o022, even though it can vary to calculate effective modes for cases when the default mode of a function is used.

If a mode value is passed to the function, it still uses that mode argument as the mode to evaluate.

Two Python loose permission rules will return results
when a function is used with a default permission mode
that is considered risky.

However, these rules were not accounting for the umask
that is typically set in the operating system and Python
honors when calculating the effective mode.

This change applies an assumed umask of 0o022, even though
it can vary to calculate effective modes for cases when
the default mode of a function is used.

If a mode value is passed to the function, it still uses
that mode argument as the mode to evaluate.

Signed-off-by: Eric Brown <eric.brown@securesauce.dev>
@ericwb ericwb merged commit 7de73b5 into securesauce:main Oct 4, 2024
8 checks passed
@ericwb ericwb deleted the umask branch October 4, 2024 00:29
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.

1 participant