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

no shell call on single command exec on *nix #1509

Merged
merged 2 commits into from
Sep 20, 2021

Conversation

eikenb
Copy link
Contributor

@eikenb eikenb commented Aug 20, 2021

Instead of always using sh -c to run command lines on *nix check if it
is a single command (no spaces) and, if so, run that command directly.

This will give users on systems without 'sh' a way to run their commands.

Fixes #1508

@eikenb eikenb added the bug label Aug 20, 2021
@eikenb eikenb added this to the 0.27.1 milestone Aug 20, 2021
@eikenb eikenb requested a review from a team August 20, 2021 21:12
@eikenb eikenb force-pushed the issue-1508-no-sh-single-command branch from 10c36d9 to d211c64 Compare August 24, 2021 22:28
@eikenb
Copy link
Contributor Author

eikenb commented Aug 24, 2021

Updated with a couple common 'sh' absolute paths as fallbacks to check if it can't find it on PATH.

Updated the docs for the new exec/command semantics.

@eikenb eikenb added the docs label Aug 24, 2021
Copy link
Contributor

@findkim findkim left a comment

Choose a reason for hiding this comment

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

Adding the sh check is a nice addition to the changed execution mode

@eikenb eikenb force-pushed the issue-1508-no-sh-single-command branch from d211c64 to 5884385 Compare August 30, 2021 21:56
Instead of always using `sh -c` to run command lines on *nix check if it
is a single command (no spaces) and, if so, run that command directly.

This will give users on systems without 'sh' a way to run their commands.

Fixes #1508
@eikenb eikenb force-pushed the issue-1508-no-sh-single-command branch from 5884385 to 0357a32 Compare September 7, 2021 23:43
@hashicorp-cla
Copy link

hashicorp-cla commented Sep 9, 2021

CLA assistant check
All committers have signed the CLA.

@eikenb eikenb merged commit edd2dcb into master Sep 20, 2021
@eikenb eikenb deleted the issue-1508-no-sh-single-command branch September 20, 2021 22:09
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.

consul-template crashes because it assumes sh is installed and added to the command before running it
3 participants