diff options
| author | David Lönnhager <david.l@mullvad.net> | 2025-03-03 15:35:55 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2025-03-05 23:32:46 +0100 |
| commit | ab3251ffabafc5ce965d5cafb4dd6c2bcef951e4 (patch) | |
| tree | c1217cfb7c5169a5d120d1f2a832ec3b7f121339 | |
| parent | 587d01d41c8c56cbc8dcb22216379ed5c425cfdc (diff) | |
| download | mullvadvpn-ab3251ffabafc5ce965d5cafb4dd6c2bcef951e4.tar.xz mullvadvpn-ab3251ffabafc5ce965d5cafb4dd6c2bcef951e4.zip | |
Improve docs for temp module
| -rw-r--r-- | installer-downloader/src/temp.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/installer-downloader/src/temp.rs b/installer-downloader/src/temp.rs index 84bf506dc4..257465d5d0 100644 --- a/installer-downloader/src/temp.rs +++ b/installer-downloader/src/temp.rs @@ -5,6 +5,9 @@ //! Since the Windows downloader runs as admin, we can use a persistent directory and prevent //! non-admins from accessing it. //! +//! The directory is created before being restricted, but this is fine as long as the checksum is +//! verified before launching the app. +//! //! # macOS //! //! The downloader does not run as a privileged user, so we store downloads in a temporary @@ -45,8 +48,7 @@ impl DirectoryProvider for TempDirProvider { /// This returns a directory where only admins have write access. /// -/// This function is a bit racey, as the directory is created before being restricted. -/// This is acceptable as long as the checksum of each file is verified before being used. +/// See [module-level](self) docs for more information. #[cfg(windows)] async fn admin_temp_dir() -> anyhow::Result<PathBuf> { /// Name of subdirectory in the temp directory @@ -65,6 +67,9 @@ async fn admin_temp_dir() -> anyhow::Result<PathBuf> { Ok(temp_dir) } +/// This returns a temporary directory for storing the downloaded app. +/// +/// See [module-level](self) docs for more information. #[cfg(target_os = "macos")] async fn temp_dir() -> anyhow::Result<PathBuf> { use rand::{distributions::Alphanumeric, Rng}; |
