diff --git a/rustfs/src/connect/registration_bootstrap.rs b/rustfs/src/connect/registration_bootstrap.rs index c1d3d21c2..c14deeb6b 100644 --- a/rustfs/src/connect/registration_bootstrap.rs +++ b/rustfs/src/connect/registration_bootstrap.rs @@ -434,10 +434,11 @@ mod tests { }; fn secure_tempdir() -> tempfile::TempDir { + let home = std::path::PathBuf::from(std::env::var_os("HOME").expect("test requires a protected home directory")); tempfile::Builder::new() .prefix(".connect-registration-bootstrap-") - .tempdir_in(env!("CARGO_MANIFEST_DIR")) - .expect("temporary directory inside the protected checkout") + .tempdir_in(home) + .expect("temporary directory inside the protected home directory") } fn create_secure_state_tree(state: &Path) { diff --git a/rustfs/tests/connect_registration_bootstrap.rs b/rustfs/tests/connect_registration_bootstrap.rs index 911f0a05e..7797b95d3 100644 --- a/rustfs/tests/connect_registration_bootstrap.rs +++ b/rustfs/tests/connect_registration_bootstrap.rs @@ -278,10 +278,11 @@ fn prepare_inputs(temp: &tempfile::TempDir, root_pem: &str) -> (std::path::PathB } fn secure_tempdir() -> tempfile::TempDir { + let home = std::path::PathBuf::from(std::env::var_os("HOME").expect("test requires a protected home directory")); tempfile::Builder::new() .prefix(".connect-registration-") - .tempdir_in(env!("CARGO_MANIFEST_DIR")) - .expect("temporary directory inside the protected checkout") + .tempdir_in(home) + .expect("temporary directory inside the protected home directory") } fn run_binary(endpoint: String, root: std::path::PathBuf, state: std::path::PathBuf, token: Vec) -> std::process::Output {