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 handling of single quotes in shell commands #1019

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alex-harvey-z3q
Copy link

Previously, if a command in the bigip_command resource contained single quotes, the constructed shell command would have unbalanced quotes, leading to syntax errors and command execution failures. This commit fixes the issue by escaping single quotes within the commands before wrapping them in single quotes. This ensures that all commands are properly formatted and executed, even if they contain single quotes.

  • Escape single quotes in commands before constructing the shell command
  • Prevents syntax errors due to unbalanced quotes
  • Enhances security by mitigating potential command injection risks

Previously, if a command in the `bigip_command` resource contained single
quotes, the constructed shell command would have unbalanced quotes,
leading to syntax errors and command execution failures. This commit fixes
the issue by escaping single quotes within the commands before wrapping
them in single quotes. This ensures that all commands are properly
formatted and executed, even if they contain single quotes.

- Escape single quotes in commands before constructing the shell command
- Prevents syntax errors due to unbalanced quotes
- Enhances security by mitigating potential command injection risks
@RavinderReddyF5
Copy link
Collaborator

Hi @alex-harvey-z3q,
Thanks for your PR.

In order to review and accept your commit, you need to sign a Customer License Agreement and send it to [email protected]

https://clouddocs.f5.com/products/orchestration/ansible/devel/_downloads/b35c2904c64e94ec52f5e300bfbebfc4/F5-Contributor-License-Agreement.pdf

@RavinderReddyF5
Copy link
Collaborator

Hi @alex-harvey-z3q,
you PR changes are taken through PR: #1025

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.

2 participants