Skip to content

Conversation

@Ramesh7
Copy link
Contributor

@Ramesh7 Ramesh7 commented Aug 29, 2023

Summary

Fixing unsafe interpolation linting issue.

Additional Context

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@Ramesh7 Ramesh7 requested a review from a team as a code owner August 29, 2023 13:44
exec { 'download_install_katello_cert_rpm':
path => ['/usr/bin', '/bin',],
command => "curl -k -o /tmp/katello-ca-consumer-latest.noarch.rpm ${satellite_url}/pub/katello-ca-consumer-latest.noarch.rpm && yum -y install /tmp/katello-ca-consumer-latest.noarch.rpm", # rubocop:disable Layout/LineLength
command => ['curl', '-k', '-o', '/tmp/katello-ca-consumer-latest.noarch.rpm', "${satellite_url}/pub/katello-ca-consumer-latest.noarch.rpm", '&&', 'yum', '-y', 'install', '/tmp/katello-ca-consumer-latest.noarch.rpm'], # rubocop:disable Layout/LineLength
Copy link

Choose a reason for hiding this comment

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

This isn't valid because it uses shell (see the &&). It can't be safely done this way.

You can split it in a file resource with ${satellite_url}/pub/katello-ca-consumer-latest.noarch.rpm" as the source and then notify a package resource, but you'll always have some intermediate file on disk.

@Ramesh7 Ramesh7 closed this Sep 27, 2023
@rajat-puppet rajat-puppet deleted the CAT-1351 branch June 6, 2024 14:46
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.

3 participants