Skip to content

Commit 6644aa2

Browse files
committed
Preserve ALFS_PASSPHRASE through sudo and bump to v0.4.6
Use --preserve-env=ALFS_PASSPHRASE in sudo calls so the LUKS passphrase reaches anylinuxfs on systems where env_reset is enforced.
1 parent 3222414 commit 6644aa2

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "anylinuxfs-gui",
3-
"version": "0.4.5",
3+
"version": "0.4.6",
44
"private": true,
55
"type": "module",
66
"scripts": {

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "anylinuxfs-gui"
3-
version = "0.4.5"
3+
version = "0.4.6"
44
edition = "2021"
55

66
[lib]

src-tauri/src/cli.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,14 @@ fn execute_with_sudo(args: &[&str], passphrase: Option<&str>) -> Result<String,
183183
let askpass_script = create_askpass_script()?;
184184

185185
// Build the command arguments for sudo with SUDO_ASKPASS
186+
// Preserve ALFS_PASSPHRASE through sudo — macOS may pass env vars through
187+
// despite env_reset, but other systems enforce it strictly
186188
let cli_path_str = cli_path.to_string_lossy();
187-
let mut sudo_args: Vec<&str> = vec!["-A", "--", &cli_path_str];
189+
let mut sudo_args: Vec<&str> = if passphrase.is_some() {
190+
vec!["-A", "--preserve-env=ALFS_PASSPHRASE", "--", &cli_path_str]
191+
} else {
192+
vec!["-A", "--", &cli_path_str]
193+
};
188194
sudo_args.extend(args.iter().copied());
189195

190196
let mut cmd = Command::new("sudo");

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "anylinuxfs-gui",
4-
"version": "0.4.5",
4+
"version": "0.4.6",
55
"identifier": "com.anylinuxfs.gui",
66
"build": {
77
"beforeDevCommand": "npm run dev",

0 commit comments

Comments
 (0)