From 19280c588988101ea2ab796877766ca5bd23f397 Mon Sep 17 00:00:00 2001 From: Imbris <2002109+Imberflur@users.noreply.github.com> Date: Sun, 11 Aug 2024 13:04:08 -0400 Subject: [PATCH] Document current default permissions for tempdirs (#296) 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 ca657cbf1..ddd93e7b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 /// @@ -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 ///