libdnf5: fix inappropriate backslash consumption in config files#2723
Open
Userfrom1995 wants to merge 1 commit into
Open
libdnf5: fix inappropriate backslash consumption in config files#2723Userfrom1995 wants to merge 1 commit into
Userfrom1995 wants to merge 1 commit into
Conversation
Contributor
Author
|
The CI failures are expected, as now we don't de-escape the double backslashes and they're passed as-is to printf, which is causing the issue. So the test stack needs updating, but before doing that I need confirmation from one of the reviewers that this is the way you guys want to go. Or maybe we can skip the vars.substitute() function for the command_format? That even sounds like a bad idea to me. |
Contributor
|
@jrohel, what is your opinion on this change? |
Contributor
Author
|
Could I get a review or any thoughts on this one? |
b9edf3c to
b137ee4
Compare
The variable substitution engine in libdnf5 was overly aggressive, unconditionally removing backslashes even when they preceded normal characters (e.g., 'M\y' became 'My'). This change restricts backslash de-escaping to only special characters: - '$' (to allow literal dollar signs) - '}' (to allow literal braces within subexpressions) This ensures that backslashes in repository names and paths are preserved literally, matching the behavior of --setopt and restoring compatibility with user expectations from DNF4. Added unit tests to verify the fix and prevent regressions. Fixes: rpm-software-management#2503 Assisted-by: GLM-5.1
b137ee4 to
34504b8
Compare
Contributor
Author
Another friendly ping for a review. |
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.
The variable substitution engine in libdnf5 was overly aggressive, unconditionally removing backslashes even when they preceded normal characters (e.g., 'M\y' became 'My').
This change restricts backslash de-escaping to only special characters:
This ensures that backslashes in repository names and paths are preserved literally, matching the behavior of --setopt and restoring compatibility with user expectations from DNF4.
Added unit tests to verify the fix and prevent regressions.
Fixes: #2503