From 1e943d00a364c720af08ae3627c5d96f48ed94d2 Mon Sep 17 00:00:00 2001 From: Imbris Date: Fri, 9 Aug 2024 20:28:14 -0400 Subject: [PATCH] Document current default permissions for tempdirs Fixes implying that the default is the same as the one for tempfiles --- src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4e78037bd..355a72e92 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 /// @@ -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 ///