You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(vault): create the vault directory before writing (fixes "io error" on first run) (#127)
On a fresh install the platform config dir (e.g. ~/.config/cairn) does not
exist until something writes there. Vault creation — triggered the first time
a credential is saved, e.g. adding an SSH host with a password — failed with a
raw "io error" because `NamedTempFile::new_in` cannot create its temp file in
a missing directory. Both vault write paths (`atomic_create` and `atomic_write`)
now ensure the parent directory exists first via a shared `ensure_parent_dir`
helper, which sets a directory it creates to owner-only 0700 on Unix (the vault
file itself is already 0600). A pre-existing user directory is left untouched.
Regression test: `Vault::create` into a path whose parent is missing now
succeeds and yields a 0700 directory.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments