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

Escaped and quoted arguments are treated differently by the launch script depending on how it is invoked #18540

Open
Swissbite opened this issue Oct 8, 2019 · 2 comments
Labels
status: on-hold We can't start working on this issue yet type: bug A general bug
Milestone

Comments

@Swissbite
Copy link

Swissbite commented Oct 8, 2019

A spring-boot application treats the escaping of arguments differently at startup as root or as user if it is not using the start-stop-daemon.

The issue was introduced with commit 4c65e5e by using printf for arguments if running as root or just passing the arguments if running as user.

How to reproduce:

  1. Create a spring-boot-application with a config file
  2. Add RUN_ARGS with single quote, like RUN_ARGS='--spring.datasource.password=my$password$with$dollars'
  • Start the application as user will add the RUN_ARGS correct, even for multiline values
  • Start the application as root will not escape the value.

Solutions to make it predictable

  • Not using the printf (may be a bad solution? )
  • Using printf in all cases as it is currently done for root
  • Using printf in all cases and reflect single quote escaping defined in the .conf file.

Additional information
I was not able to test against the start-stop-daemon. It might by that it is also ignoring the single quote arguments given in the .conf file.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 8, 2019
@wilkinsona wilkinsona changed the title spring-boot-loader-tool launch.script - Not equal execution if script is startet as root or as user spring-boot-loader-tool launch.script - Not equal execution if script is started as root or as user Oct 8, 2019
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Oct 8, 2019
@philwebb philwebb added type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Oct 25, 2019
@philwebb philwebb added this to the 2.1.x milestone Oct 25, 2019
@Swissbite
Copy link
Author

Update for peoples who may have the same issue:

Simple workaround:

  • Add an application.properties anywhere near your deployment path
  • Add following config to the run args--spring.config.additional-location=./path/to/folder/

Documentation about this config property: 2.3. Application Property Files

@wilkinsona wilkinsona changed the title spring-boot-loader-tool launch.script - Not equal execution if script is started as root or as user Escaped and quoted arguments are treated differently by the launch script depending on how it is invoked Jan 15, 2020
@wilkinsona
Copy link
Member

wilkinsona commented Feb 27, 2020

To reduce the risk of regression, we should tackle #20335 before fixing this issue.

@wilkinsona wilkinsona modified the milestones: 2.1.x, 2.2.x Feb 27, 2020
@wilkinsona wilkinsona added status: blocked An issue that's blocked on an external project change status: on-hold We can't start working on this issue yet and removed status: blocked An issue that's blocked on an external project change labels Feb 27, 2020
@philwebb philwebb modified the milestones: 2.2.x, 2.3.x Dec 16, 2020
@wilkinsona wilkinsona modified the milestones: 2.3.x, 2.4.x Jun 10, 2021
@wilkinsona wilkinsona modified the milestones: 2.4.x, 2.5.x Nov 15, 2021
@wilkinsona wilkinsona modified the milestones: 2.5.x, 2.6.x May 19, 2022
@wilkinsona wilkinsona modified the milestones: 2.6.x, 2.7.x Nov 24, 2022
@philwebb philwebb modified the milestones: 2.7.x, 3.1.x Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: on-hold We can't start working on this issue yet type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants