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

Fix regression in apply-config-from-env.py #9097

Merged

Conversation

codelipenghui
Copy link
Contributor

Motivation

Fix the regression that introduced in #8709

In #8709, if values contain spaces, the value will be wrapped as "value", this will introduce break changes while users already have some configs with the value that contains spaces, so this PR is reverting this change.

If users want to ensure some values are processed as a group, they should use export key=\"value\" instead of implicitly adding "" when encountering spaces

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@codelipenghui
Copy link
Contributor Author

@klwilson227 Please help review this PR, thanks.

@sijie
Copy link
Member

sijie commented Dec 31, 2020

/pulsarbot run-failure-checks

Copy link
Contributor

@klwilson227 klwilson227 left a comment

Choose a reason for hiding this comment

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

Removing the change: will put thing back. But will cause the following issues which may or may not be a concern for all customers:

  1. setting the value with embedded quotes, may cause some additional support issues as it is not clear that the escaping of the quotes is required to have the quotes apply.
  2. this opens a issue in security that allows code injection by the value passed as there is no validation. What you set in the yaml is not guaranteed to be the value in the script.

\”myvalue\”;ls /; Would result in ls of / directory being executed.

my tendency is to be more secure with what you set is what ends up in the variable.

If you proceed with the rollback my vote would be to issue a warning message from the script when a space is in the value but it is not quoted. So that the error in setting without the escaped quotes becomes a self correcting problem.
But then the issue with code injection still remains.

@codelipenghui
Copy link
Contributor Author

@klwilson227 this PR just rollback the regression, we already encountered the regression after start the new version Pulsar with the old configuration and the problem is very hidden. Rollback just wants to keep the compatibility, we don’t want to see users who may not be able to start broker after upgrading.

I agree with your worry, so could you please help create an issue for it? so that we can start to discuss under the issue to find a better way.

@hangc0276
Copy link
Contributor

/pulsarbot run-failure-checks

@codelipenghui codelipenghui force-pushed the penghui/config_apply_regression branch from 2d1f250 to bf842be Compare January 3, 2021 02:56
@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 4ad499d into apache:master Jan 4, 2021
@codelipenghui codelipenghui deleted the penghui/config_apply_regression branch January 4, 2021 00:54
codelipenghui added a commit that referenced this pull request Jan 6, 2021
### Motivation

Fix the regression that introduced in #8709 

In #8709, if values contain spaces, the value will be wrapped as "value", this will introduce break changes while users already have some configs with the value that contains spaces, so this PR is reverting this change.

If users want to ensure some values are processed as a group, they should use `export key=\"value\"` instead of implicitly adding `""` when encountering spaces

(cherry picked from commit 4ad499d)
codelipenghui added a commit that referenced this pull request Jan 7, 2021
### Motivation

Fix the regression that introduced in #8709 

In #8709, if values contain spaces, the value will be wrapped as "value", this will introduce break changes while users already have some configs with the value that contains spaces, so this PR is reverting this change.

If users want to ensure some values are processed as a group, they should use `export key=\"value\"` instead of implicitly adding `""` when encountering spaces

(cherry picked from commit 4ad499d)
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants