Skip to content

Fix non-ASCII (Korean) repo backup failure#2370

Merged
m3nu merged 3 commits intoborgbase:masterfrom
GabrielDougherty:non-ascii-repo-fix
Feb 4, 2026
Merged

Fix non-ASCII (Korean) repo backup failure#2370
m3nu merged 3 commits intoborgbase:masterfrom
GabrielDougherty:non-ascii-repo-fix

Conversation

@GabrielDougherty
Copy link
Contributor

@GabrielDougherty GabrielDougherty commented Feb 3, 2026

Description

This PR fixes an issue where backing up to a repository with a non-ASCII (Korean) name failed due to incorrect length checking logic on MacOS. I updated the code to do .encode() to pass the length in bytes, rather than the simple character length, since Korean characters are multi-byte and since the Apple function SecKeychainFindGenericPassword appears to use byte length. The docs are ambiguous on whether they use byte length:

serviceNameLength
The length of the serviceName character string.

but my change is consistent with the behavior of C strlen() UTF-8 handling, and it fixes the issue.

Related Issue

#2332

Motivation and Context

Backups weren't working when using a repository with a Korean name.

How Has This Been Tested?

I ran through the reproduction steps in the linked issue with my change and observed that the backup worked, while it failed without the change.

Screenshots (if appropriate):

Screenshot 2026-02-03 at 5 44 27 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

m3nu
m3nu previously approved these changes Feb 4, 2026
@GabrielDougherty
Copy link
Contributor Author

I think I've fixed the test failure, by doing a conditional import for the MacOS-specific module. 🤞

@m3nu m3nu merged commit f9ae8a2 into borgbase:master Feb 4, 2026
5 checks passed
@m3nu
Copy link
Contributor

m3nu commented Feb 4, 2026

Thanks for the useful addition!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants