Skip to content

vault: replace $HOME fallback with cross-platform home dir #8

@MasonStation

Description

@MasonStation

Encrypted file vault path reads $HOME directly and falls back to /tmp. On Windows $HOME is normally unset (the equivalent is %USERPROFILE%) and /tmp does not exist.

Location

  • phantom-vault/src/lib.rs:72

Current

std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string())

Fix

Use dirs::home_dir() (already in the dep tree) or directories::ProjectDirs::from("ai", "ashlr", "phantom") for a proper per-OS config path:

  • Windows: %APPDATA%\phantom
  • Linux: ~/.config/phantom
  • macOS: ~/Library/Application Support/phantom

Severity

Functional gap — file vault writes to wrong location or fails outright on Windows.

Tracker: #1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwindowsWindows platform support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions