fix: skip chmod for already-private identity dir #76
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/secure-existing-identity-dir-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The v2.2.5 dev image failed the live dev gate on relay-vm while running as UID 65532. Startup looped at identity initialization because
ensure_private_diralways attemptedchmod 0700on the bind-mounted/portal-certsdirectory:The host directory was already secure: mode
0700, owner65532:65532, so the chmod was unnecessary.Approach
On Unix,
set_dir_modenow checks the existing mode first and returns early when it already matches the requested private mode. This preserves strict permission enforcement when correction is needed, while avoiding a no-op chmod that can fail on restricted bind mounts/non-root container runtimes.Validation
cargo fmt --checkcargo test --locked -p portal-relay state::identity::tests::relay_identity_file_is_privateValidation was run in the Linux Docker toolchain on
uvmbecause macOS cannot build the Linux netlink dependency tree for this package.