Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced variable injection #6

Open
mattsb42-aws opened this issue Oct 30, 2019 · 1 comment
Open

Advanced variable injection #6

mattsb42-aws opened this issue Oct 30, 2019 · 1 comment
Labels
blocks next release This issue must be fixed before the next release
Milestone

Comments

@mattsb42-aws
Copy link
Member

If environment variable values being injected contain special characters, notably any of ", ', \, and probably more, shlex gets very confused when we attempt to split the command after injection.

The current flow is:

  1. Inject values
  2. shlex.split
  3. shlex.quote

I think that the correct approach here might simply be to:

  1. shlex.split (keeping Add Windows testing and validate command processing #5 in mind)
  2. Inject values in each split command
  3. shlex.quote
@mattsb42-aws mattsb42-aws added the blocks next release This issue must be fixed before the next release label Oct 30, 2019
@mattsb42-aws
Copy link
Member Author

point to investigate:

Since we're explicitly not passing the command to the shell in the subprocess.run execution, we probably do not need to shlex.quote the values. Test this and make sure; if we don't need to, don't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocks next release This issue must be fixed before the next release
Projects
None yet
Development

No branches or pull requests

1 participant