"prlsrvct info --json" does not properly escape output

Discussion in 'Parallels Provider for Vagrant' started by BenjaminJ1, Aug 31, 2015.

  1. BenjaminJ1

    BenjaminJ1 Bit Poster

    Messages:
    2
    Hello,
    I am attempting to use the vagrant-parallels provider with Parallels Desktop 10.2.2. I have discovered what I think is a bug in "prlsrvct info --json". It outputs invalid JSON on my system, because one of my disks has a double-quote in its device info. Excerpt:
    Code:
    "/dev/disk3": {
        "name": "SAMSUNG SSD PM830 2.5" 7mm 128GB (disk3)",
        "type": "hdd"
    },
    This output is invalid JSON due to the unescaped double quote in 2.5", so the program (vagrant in this case) cannot parse prlsrvct's output. prlsrvct should be escaping all the values it reads from the system when generating JSON output.
    Thanks,
    Ben
     
  2. Mikhail Zholobov

    Mikhail Zholobov Parallels Developers

    Messages:
    49
    Confirmed - actually, "prlsrvctl" does not escape special symbols in JSON-formatted output which causes that kind of issues.
    I have reported this problem to the responsible people at Parallels.
    Will let you know about any updates on this.
     
  3. BenjaminJ1

    BenjaminJ1 Bit Poster

    Messages:
    2
    Is this ever going to be fixed? Someone else recently reported having the same problem (invalid JSON from prlsrvctl) in this issue on the Parallels vagrant provider: https://github.com/Parallels/vagrant-parallels/issues/242
    Since my original post I've updated to Parallels 10.3.0 (29227). It still outputs invalid JSON.
    Can you please fix prlsrvctl to escape its JSON output? It should be extremely easy since every JSON library under the sun will do it for you.
     
  4. Mikhail Zholobov

    Mikhail Zholobov Parallels Developers

    Messages:
    49
    I'm sorry for the late response. The issue you've originally reported has been fixed in Parallels Desktop 11.1.1. Unfortunately, the fix hasn't landed to Parallels Desktop 10.3.0 update and currently I can't say anything about plans for the next update for 10th major version.
    But if you upgrade to the latest Parallels Desktop 11, the problem with invalid JSON should be solved (at least, for your case).

    About the issue https://github.com/Parallels/vagrant-parallels/issues/242
    This is a regression introduced by the fix I've mentioned above. :)
    In Parallels Desktop 11.1.1+ double quotes and other special characters are escaped now, but by some reason they are also escaped in the list object, the value of "Require password to". I've posted a workaround there: comment
    Fortunately this issue has been finally fixed already and the fix will be released in the next update of Parallels Desktop 11
     
  5. Mikhail Zholobov

    Mikhail Zholobov Parallels Developers

    Messages:
    49

Share This Page