fix: strip double quotes from sftp.args flags to prevent restic parse error#1237
Open
wahajahmed010 wants to merge 1 commit into
Open
fix: strip double quotes from sftp.args flags to prevent restic parse error#1237wahajahmed010 wants to merge 1 commit into
wahajahmed010 wants to merge 1 commit into
Conversation
… error The UI constructs sftp.args flags with double-quoted paths (e.g. -i "/root/.ssh/key"), which causes restic's pflag parser to fail with 'bare " in non-quoted-field'. The sanitizeRepoFlags function now strips double quotes from sftp.args values since they are not needed when passed as sftp subcommand arguments. Fixes garethgeorge#1227
|
Wahaj Ahmed seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1227
Problem
When configuring an SFTP repository with custom sftp.args containing quoted paths, Backrest 1.13.0 generates an invalid --option=sftp.args=... flag that restic cannot parse:
This prevents users from modifying or saving SFTP repository configurations.
Fix
Updated sanitizeRepoFlags to strip double quotes from sftp.args values. Double quotes are not needed in the sftp.args context because restic passes these values directly to the sftp command. The -i @ workaround is preserved.
Added TestSanitizeRepoFlags with coverage for quote stripping, the -i @ workaround, and edge cases.