Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-22

run_ssh_command may produce unexpected results if invalid identity key path is specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.4
    • vcld (backend)
    • None

    Description

      The run_ssh_command subroutine in utils.pm may produce unexpected results if invalid identity key paths are specified. To reproduce, call the subroutine with multiple identity paths, the first one being invalid:

      run_ssh_command([node], "/etc/vcl/invalid.key /etc/vcl/good.key", "uname")

      SSH first tries to use the invalid key and will output the following:
      Warning: Identity file /etc/vcl/invalid.key not accessible: No such file or directory.

      SSH then tries the next identity key and succeeds. The run_ssh_command subroutine returns an array. The first element is the exit status. In this case it would be 0 meaning successful. The 2nd element is a reference to an array containing the lines of output generated by SSH as it ran the command. This array contains the warning message followed by the expected output as the command successfully ran.

      Callers of run_ssh_command see the command as being successful because of the exit status. If the output is checked, callers may see the command as failing because the warning messages are mixed into the output.

      Fix the subroutine to not include the warning output if the intended command is successful.

      Attachments

        Activity

          People

            arkurth Andrew Kurth
            arkurth Andrew Kurth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: