fix: auto-translation of user-prefixed Mac and Linux paths for the vault password file when running inside a sandbox

This commit is contained in:
2026-06-18 10:53:38 -06:00
parent 2f33b6631e
commit f2e8f3ab59
3 changed files with 277 additions and 5 deletions
+19 -4
View File
@@ -274,10 +274,25 @@ impl AppConfig {
pub fn vault_password_file(&self) -> PathBuf {
match &self.vault_password_file {
Some(path) => match path.exists() {
true => path.clone(),
false => gman::config::Config::local_provider_password_file(),
},
Some(path) => {
if path.exists() {
return path.clone();
}
if let Some(translated) = paths::translate_sandboxed_home_path(path)
&& translated.exists()
{
info!(
"vault_password_file '{}' not found; resolved to sandboxed path '{}'",
path.display(),
translated.display()
);
return translated;
}
gman::config::Config::local_provider_password_file()
}
None => gman::config::Config::local_provider_password_file(),
}
}