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

Fixes #36082 - Ensure character & is escaped on ks URL #9620

Closed
wants to merge 1 commit into from

Conversation

jpasqualetto
Copy link
Contributor

This changes will ensure that character & is properly escaped on any ks URL used for provisioning.

@theforeman-bot
Copy link
Member

Issues: #36082

@@ -39,19 +39,19 @@ description: |
# both current and legacy syntax provided
if (is_fedora && os_major >= 33) || (rhel_compatible && os_major >= 9)
if subnet4 && !subnet4.dhcp_boot_mode?
options.push("inst.ks=#{foreman_url('provision', static: '1')}")
options.push("inst.ks=#{foreman_url('provision', static: '1').gsub('&','\\\\&')}")
Copy link
Contributor

@wbclark wbclark Feb 14, 2023

Choose a reason for hiding this comment

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

Suggested change
options.push("inst.ks=#{foreman_url('provision', static: '1').gsub('&','\\\\&')}")
options.push("inst.ks=" + format("'%s'", foreman_url('provision', static: '1')))

one thought: quoting the URL for grub should also work, could prevent similar future issues from occurring for other characters than &, and might be a bit easier to read for the next engineer vs. trying to figure out which escapes are in which layer... what do you think?

either way, it's probably a good idea to give the same treatment as well to the lines which set inst.repo and inst.stage2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My provisioning tests failed when using "PXELinux BIOS" as PXE Loader and a quoted URL for ks.

That's why I went for this approach, which worked for both "PXELinux BIOS" and "Grub2 UEFI".

@stejskalleos
Copy link
Contributor

I'm closing the PR, it's duplicate to #9477, let's continue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants