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

Fix access mode of files created (#2530) #2733

Merged
merged 1 commit into from
Jan 29, 2022
Merged

Conversation

arogge
Copy link
Contributor

@arogge arogge commented Jan 26, 2022

The previous fix for this in 4a85db1 was incomplete. The intent was to
mimic what fopen() is doing. As per standard[1] fopen() also sets
S_IWGRP and S_IWOTH and lets the umask handle the rest.

[1] https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/fopen.html

The previous fix for this in 4a85db1 was incomplete. The intent was to
mimic what `fopen()` is doing. As per standard[1] `fopen()` also sets
`S_IWGRP` and `S_IWOTH` and lets the umask handle the rest.

[1] https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/fopen.html
@arogge
Copy link
Contributor Author

arogge commented Jan 26, 2022

Do we need automated test for that and if so: how would you like it implemented?

@vitaut
Copy link
Contributor

vitaut commented Jan 27, 2022

Thanks for the PR! A test would be nice, please add one to https://github.com/fmtlib/fmt/blob/master/test/os-test.cc (it can be POSIX-specific/disabled on Windows for simplicity).

@vitaut
Copy link
Contributor

vitaut commented Jan 29, 2022

Anyway, this is a straightforward fix so I'm merging this in but a PR with a test would be welcome.

@vitaut vitaut merged commit ae1aaae into fmtlib:master Jan 29, 2022
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.

2 participants