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

Document default permissions for tempdirs #296

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ impl<'a, 'b> Builder<'a, 'b> {
}

/// The permissions to create the tempfile or [tempdir](Self::tempdir) with.
/// This allows to them differ from the default mode of `0o600` on Unix.
///
/// # Security
///
Expand All @@ -347,9 +346,13 @@ impl<'a, 'b> Builder<'a, 'b> {
/// # Platform Notes
/// ## Unix
///
/// The actual permission bits set on the tempfile or tempdir will be affected by the
/// `umask` applied by the underlying syscall.
/// The actual permission bits set on the tempfile or tempdir will be affected by the `umask`
/// applied by the underlying syscall. The actual permission bits are calculated via
/// `permissions & !umask`.
///
/// Permissions default to `0o600` for tempfiles and `0o777` for tempdirs. Note, this doesn't
/// include effects of the current `umask`. For example, combined with the standard umask
/// `0o022`, the defaults yield `0o600` for tempfiles and `0o755` for tempdirs.
///
/// ## Windows and others
///
Expand Down