Skip to content

credential_store follow-ups: symlink semantics, keys_cli coverage, dir fsync #405

Description

@justrach

Deferred minors from the review of fix/oauth-atomic-writes-perms (merged for v0.0.239).

  1. Rename-into-place replaces a symlinked target instead of writing through it. credential_store.replaceFile on a settings.json -> real.json symlink replaces the symlink with a regular file, leaving real.json stale. Decide the policy (resolve symlinks before staging, or document replacement) — today it is silent.
  2. keys_cli.zig conversion is untested on its live platforms. The file path is dead on macOS (storeKey short-circuits to the keychain), so the atomic conversion there runs only on Linux/Windows where we have no local coverage. Also the comment overstates 0600 on Windows: private_file degrades to .default_file and the chmod block is comptime-elided (has_executable_bit == false).
  3. Directory fsync (power-loss durability). replaceFile fsyncs the temp file but not the containing directory, so the rename itself is not durable across power loss (fine across process crashes). Matches the pre-existing in-tree pattern (learn_store, eval_memory); qualify or harden as a batch if it ever matters.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions