Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-30699

Shell commands fail for cases with quotes for buildscripts/remote_operations.py

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.5.13
    • None
    • Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • TIG 2017-09-11

    Description

      There are still some cases where the "shell" remote operation fails to pass the parameters properly to a remote script. The best way to handle this is as follows:

      1. Run all shell operations through bash -c "<commands>"
      2. If <commands> has any quotes, singe ' or double ", then escape them and surround the commands with a $'<commands>'

      Example:
      The command /tmp/a.sh -a abc -b "hi there" -c "also here" should be invoked as /bin/bash -c "$'/tmp/a.sh -a abc -b \"hi there\" -c \"also here\"'"

      Attachments

        Activity

          People

            jonathan.abrahams Jonathan Abrahams
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: