Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed JSON command output when non-ASCII strings are present #4634

Closed
wants to merge 3 commits into from

Commits on May 9, 2015

  1. mon/OSDMonitor: require mon_allow_pool_delete = true to remove pools

    This is a simple safety check.  Since we default to true it is currently
    opt-in.
    
    Backport: giant, firefly
    Signed-off-by: Sage Weil <sage@redhat.com>
    (cherry picked from commit 6b982e4)
    liewegas authored and smithfarm committed May 9, 2015
    Copy the full SHA
    47eecaf View commit details
    Browse the repository at this point in the history
  2. json_spirit: use utf8 intenally when parsing \uHHHH

    When the python CLI is given non-ASCII characters, it converts them to
    \uHHHH escapes in JSON.  json_spirit parses these internally into 16 bit
    characters, which could only work if json_spirit were built to use
    std::wstring, which it isn't; it's using std::string, so the high byte
    ends up being zero'd, leaving the low byte which is effectively garbage.
    
    This hack^H^H^H^H change makes json_spirit convert to utf8 internally
    instead, which can be stored just fine inside a std::string.
    
    Note that this implementation still assumes \uHHHH escapes are four hex
    digits, so it'll only cope with characters in the Basic Multilingual
    Plane.  Still, that's rather a lot more characters than it could cope
    with before ;)
    
    (For characters outside the BMP, Python seems to generate escapes in the
    form \uHHHHHHHH, i.e. 8 hex digits, which the current implementation
    doesn't expect to see)
    
    Fixes: ceph#7387
    
    Signed-off-by: Tim Serong <tserong@suse.com>
    (cherry picked from commit 8add15b)
    tserong authored and smithfarm committed May 9, 2015
    Copy the full SHA
    5369e10 View commit details
    Browse the repository at this point in the history
  3. json_sprit: fix the FTBFS on old gcc

    Fixes: ceph#11574
    Signed-off-by: Kefu Chai <kchai@redhat.com>
    (cherry picked from commit 6b68b27)
    tchaikov authored and smithfarm committed May 9, 2015
    Copy the full SHA
    010065e View commit details
    Browse the repository at this point in the history