[client] Set 0644 perms on SSH client config after os.CreateTemp (#6126)

This commit is contained in:
Viktor Liu
2026-05-12 22:05:53 +09:00
committed by GitHub
parent 1224d6e1ee
commit 9126a192ca

View File

@@ -252,6 +252,10 @@ func (m *Manager) writeSSHConfig(sshConfig string) error {
return fmt.Errorf("write SSH config file %s: %w", tmpPath, err)
}
if err := os.Chmod(tmpPath, 0644); err != nil {
return fmt.Errorf("chmod SSH config file %s: %w", tmpPath, err)
}
if err := os.Rename(tmpPath, sshConfigPath); err != nil {
return fmt.Errorf("rename SSH config %s -> %s: %w", tmpPath, sshConfigPath, err)
}