-
Notifications
You must be signed in to change notification settings - Fork 120
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 persisted with 600 permissions #157
Comments
More documentation would definitely be helpful. Specifically:
1. We need documentation on `NamedTempFile::new` explaining the default mode.
2. We need documentation on `Builder` explaining the defaults.
3. We need documentation on `persist` stating that it leaves the mode as-is (e.g., defaults to 600).
Unfortunately, I can't think of a good way to actually change this behavior:
1. We assume that the tempfile directory may be shared, so we create files with 600.
2. If we change the mode after persisting, the operation wouldn't be atomic, which may cause even harder to track down issues.
Ideally, we'd, provide a way to set the default mode in the `Builder`. There was a patch to do this, but, IIRC, it wasn't cross platform.
|
@Stebalien do you know where to find said patch? Perhaps there's a way to make it cross-platform. |
We can now set default permissions ( |
acheronfail
added a commit
to acheronfail/repgrep
that referenced
this issue
Apr 19, 2024
The solution doesn't really make our code any better anyway, so just leaving the current behaviour as is.
acheronfail
added a commit
to acheronfail/repgrep
that referenced
this issue
Apr 20, 2024
update due to Stebalien/tempfile#157 being closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have noticed that the permission of a persisted
NamedTempFile
is 600, but I was expecting it to be 644 (default permissions when creating a file).I could be mistaken, but i found no mention of that in the doc? Maybe this could be part of the persist documentation?
I can issue a PR if needed.
The text was updated successfully, but these errors were encountered: