Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-21554

global registration command should not execute bash when an error occured

XMLWordPrintable

    • 0
    • False
    • Moderate
    • sat-proton
    • None
    • None
    • None
    • None
    • No

      Description of problem:
      Today we call `curl -sS … | bash`, which means that if curl for some reason fails, bash is still executed.
      This especially means that if curl fetches an error page, the error page is executed:

      bash: line 1: html: No such file or directory
      bash: line 2: head: No such file or directory
      bash: line 3: !--: No such file or directory
      bash: line 4: !--: No such file or directory
      bash: line 5: meta: No such file or directory
      bash: line 6: title: No such file or directory
      bash: line 7: style: No such file or directory
      bash: line 8: BODY: command not found
      bash: line 9: font-family: command not found
      bash: line 9: $'\r': command not found
      bash: line 10: font-size: command not found
      ...
      bash: line 71: tr: No such file or directory
      bash: line 72: syntax error near unexpected token `<'
      'ash: line 72: ` <td><blockquote>

      If we call curl with -sSf, it will not output the error page and will not try to execute possibly bad code on the user system.

      Version-Release number of selected component (if applicable):
      all of them

      How reproducible:
      100%

      Steps to Reproduce:
      1. make the registration template endpoint return an error
      2. call curl | bash

      Actual results:
      see above

      Expected results:
      errored out, no bad commands executed

      Additional info:

              Unassigned Unassigned
              egolov@redhat.com Evgeni Golov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: