From 1bce7397a496ca0cecf67fb5e3ec69d90fc871b0 Mon Sep 17 00:00:00 2001 From: Benjamin Demetz <50681275+Benji377@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:22:11 +0200 Subject: [PATCH] fix: Returns a warning instead of panicking if an AppImage is not mounted, closes #7736 (#7843) Co-authored-by: Lucas Nogueira Co-authored-by: Lucas Fernandes Nogueira --- .changes/validate-appimage.md | 5 +++++ core/tauri-utils/Cargo.toml | 1 + core/tauri-utils/src/lib.rs | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changes/validate-appimage.md diff --git a/.changes/validate-appimage.md b/.changes/validate-appimage.md new file mode 100644 index 000000000000..9a6367a82a7a --- /dev/null +++ b/.changes/validate-appimage.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Fix the validation of `std::env::current_exe` warn the user if AppImage is not mounted instead of panicking diff --git a/core/tauri-utils/Cargo.toml b/core/tauri-utils/Cargo.toml index 7da87f5c339c..9e36ad268048 100644 --- a/core/tauri-utils/Cargo.toml +++ b/core/tauri-utils/Cargo.toml @@ -38,6 +38,7 @@ memchr = "2" semver = "1" infer = "0.12" dunce = "1" +log = "0.4.20" [target."cfg(target_os = \"linux\")".dependencies] heck = "0.4" diff --git a/core/tauri-utils/src/lib.rs b/core/tauri-utils/src/lib.rs index 11794fef8789..54a4328561fc 100644 --- a/core/tauri-utils/src/lib.rs +++ b/core/tauri-utils/src/lib.rs @@ -22,6 +22,8 @@ use std::{ use semver::Version; use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use log::warn; + pub mod assets; pub mod config; pub mod html; @@ -306,7 +308,7 @@ impl Default for Env { .unwrap_or(true); if !is_temp { - panic!("`APPDIR` or `APPIMAGE` environment variable found but this application was not detected as an AppImage; this might be a security issue."); + warn!("`APPDIR` or `APPIMAGE` environment variable found but this application was not detected as an AppImage; this might be a security issue."); } } env