Project

General

Profile

Bug #33033

Content host registration using command generated from global registration form fails if activation key name contains ' (single quote) in it.

Added by Leos Stejskal 11 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host registration
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1978709

Description of problem:
Content host registration using command generated from global registration form fails if activation key name contains ' (single quote) in it.

Version-Release number of selected component (if applicable):
- Satellite 6.10.0 snap 7

How reproducible:
- Always

Steps to Reproduce:
1. Create activation key with name containing '(single quote) e.g ak ' rhel
2. Go to Hosts > All Hosts > click on Register Host
3. Use activation key created to generate host registration command.
4. Use generated command to register content host with satellite.

Actual results: #
  1. Running registration #
    bash: line 206: unexpected EOF while looking for matching `''
    bash: line 211: syntax error: unexpected end of file

Expected results:
- As it's activation key name is valid, host registration using generated
command should work.

Additional info:
- I have only tried this with activation key but this could be issue with other fields in the form as well.

Associated revisions

Revision 9c1b18ff (diff)
Added by Stejskal Leos 10 months ago

Fixes #33033 - shell_escape template macro

New template macro `shell_escape` using
Ruby's `Shellwords.shellescape` for safe shell strings.

Use `shell_escape` for user input variables
in registration templates (`global` & `host_init`)

History

#1 Updated by Leos Stejskal 11 months ago

  • Assignee set to Leos Stejskal
  • Category set to Host registration

#2 Updated by The Foreman Bot 10 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8687 added

#3 Updated by The Foreman Bot 10 months ago

  • Fixed in Releases 3.0.0 added

#4 Updated by Anonymous 10 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by The Foreman Bot 10 months ago

  • Pull request https://github.com/theforeman/foreman/pull/8707 added

#6 Updated by Tomer Brisker 10 months ago

  • Fixed in Releases 2.5.3 added

Also available in: Atom PDF