Skip to content

Check invalid environment replacement form like ${VAR:%}#5146

Merged
tonistiigi merged 1 commit intomoby:masterfrom
kariya-mitsuru:check-invalid-env-replacement
Aug 12, 2024
Merged

Check invalid environment replacement form like ${VAR:%}#5146
tonistiigi merged 1 commit intomoby:masterfrom
kariya-mitsuru:check-invalid-env-replacement

Conversation

@kariya-mitsuru
Copy link
Copy Markdown
Contributor

Environment replacement form like below are invalid, so they should cause error.

  • ${VAR:#pattern}
  • ${VAR:##pattern}
  • ${VAR:%pattern}
  • ${VAR:%%pattern}

Environment replacement form like below are invalid, so they should
cause error.

- `${VAR:#pattern}`
- `${VAR:##pattern}`
- `${VAR:%pattern}`
- `${VAR:%%pattern}`

Signed-off-by: Mitsuru Kariya <[email protected]>
@tonistiigi tonistiigi requested a review from jsternberg July 12, 2024 18:11
@tonistiigi
Copy link
Copy Markdown
Member

cc @tstenner (ref #5052 as well)

@tstenner
Copy link
Copy Markdown

LGTM

Copy link
Copy Markdown
Collaborator

@jsternberg jsternberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. As a note for the future, this lexing code is getting sufficiently complicated enough that using a lexer generator may end up being easier to reason with and maintain. That's not important for this PR though.

@tonistiigi tonistiigi merged commit add7328 into moby:master Aug 12, 2024
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.

4 participants