From b77877fd2c643c810659fd059cb1bca5b2c68238 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sun, 12 Jun 2022 17:44:19 -0700 Subject: [PATCH] fix(updater): set tmp folder permissions (#4311) --- .changes/updater-tmp-folder-permission.md | 5 +++++ core/tauri/src/updater/core.rs | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changes/updater-tmp-folder-permission.md diff --git a/.changes/updater-tmp-folder-permission.md b/.changes/updater-tmp-folder-permission.md new file mode 100644 index 000000000..6cc2119e6 --- /dev/null +++ b/.changes/updater-tmp-folder-permission.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Set permission to `0o700` for the tmp folder used to move the current AppImage on the updater process. diff --git a/core/tauri/src/updater/core.rs b/core/tauri/src/updater/core.rs index f422f5b0f..44e3fb2a1 100644 --- a/core/tauri/src/updater/core.rs +++ b/core/tauri/src/updater/core.rs @@ -641,9 +641,13 @@ impl Update { #[cfg(feature = "updater")] #[cfg(target_os = "linux")] fn copy_files_and_run(archive_buffer: R, extract_path: &Path) -> Result { + use std::os::unix::fs::PermissionsExt; let tmp_dir = tempfile::Builder::new() .prefix("tauri_current_app") .tempdir()?; + let mut perms = std::fs::metadata(tmp_dir.path())?.permissions(); + perms.set_mode(0o700); + std::fs::set_permissions(tmp_dir.path(), perms)?; let tmp_app_image = &tmp_dir.path().join("current_app.AppImage");