[PR #5867] [MERGED] [client] Use atomic write/rename pattern for ssh config #28668

Closed
opened 2026-08-05 08:06:44 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5867
Author: @lotheac
Created: 4/13/2026
Status: Merged
Merged: 5/4/2026
Merged by: @lixmal

Base: mainHead: push-yxxuyyrxxlls


📝 Commits (1)

  • 7f6735d ssh config manager: use atomic write/rename pattern

📊 Changes

1 file changed (+6 additions, -1 deletions)

View changed files

📝 client/ssh/config/manager.go (+6 -1)

📄 Description

otherwise, ssh can fail due while the config file is being written and incomplete.

Describe your changes

We've seen some errors running ssh when netbird is managing /etc/ssh_config.d/99-netbird.conf -- ssh might read an incomplete file if the netbird client happens to be in the middle of writing to it.

none

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

This is a bug fix and does not need to be documented separately.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced SSH configuration file writing process for improved reliability and consistency.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5867 **Author:** [@lotheac](https://github.com/lotheac) **Created:** 4/13/2026 **Status:** ✅ Merged **Merged:** 5/4/2026 **Merged by:** [@lixmal](https://github.com/lixmal) **Base:** `main` ← **Head:** `push-yxxuyyrxxlls` --- ### 📝 Commits (1) - [`7f6735d`](https://github.com/netbirdio/netbird/commit/7f6735da3652a16e30d26d956e57a63fdd8eb9ce) ssh config manager: use atomic write/rename pattern ### 📊 Changes **1 file changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `client/ssh/config/manager.go` (+6 -1) </details> ### 📄 Description otherwise, ssh can fail due while the config file is being written and incomplete. ## Describe your changes We've seen some errors running `ssh` when netbird is managing /etc/ssh_config.d/99-netbird.conf -- `ssh` might read an incomplete file if the netbird client happens to be in the middle of writing to it. ## Issue ticket number and link none ## Stack <!-- branch-stack --> ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) This is a bug fix and does not need to be documented separately. ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Enhanced SSH configuration file writing process for improved reliability and consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:06:44 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28668