Split mount directives on the first equals sign#2016
Open
devops-thiago wants to merge 1 commit into
Open
Conversation
Parser.mount split each comma-separated directive with maxSplits: 2, which yields three components when the value itself contains an equals sign. The parser then requires exactly two components, so any mount whose source or destination path contains "=" failed with "invalid directive format missing value". Equals signs are legal in POSIX path names. Splitting on the first equals sign keeps the remainder as the value. Fixes apple#2012
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.
Type of Change
Motivation and Context
Fixes #2012.
Parser.mountsplits each comma-separated directive withmaxSplits: 2. In Swift that parameter counts splits rather than resulting elements, so a value that itself contains an equals sign produces three components:The parser then requires exactly two components and throws
invalid directive format missing value. Equals signs are legal in POSIX path names, so a bind mount whose source or destination contains one cannot be used today.Splitting on the first equals sign keeps the remainder as the value. Directives that carry no value, such as
readonly, still produce a single component and are unaffected.#1978 and #1999 fix the same defect in
Parser.labels. Neither changesParser.mount.Testing
testMountBindSourceContainingEqualscreates a directory whose name contains an equals sign and mounts it by absolute path. Against the current code the test fails withinvalid directive format missing value; with this change it passes. The existing mount and publish-port tests continue to pass.