Skip to content

Commit

Permalink
Document current default permissions for tempdirs (#296)
Browse files Browse the repository at this point in the history
Fixes implying that the default is the same as the one for tempfiles
  • Loading branch information
Imberflur authored Aug 11, 2024
1 parent c5eac9f commit 19280c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,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 @@ -350,9 +349,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

0 comments on commit 19280c5

Please sign in to comment.