From: Kefu Chai Date: Tue, 18 Jun 2019 14:02:57 +0000 (+0800) Subject: auth/KeyRing: escape quotes around commands X-Git-Tag: v14.2.3~92^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=886bc940d2b7c390fbc2d384b2f152e4401384b9;p=ceph.git auth/KeyRing: escape quotes around commands so the exported auth can be re-imported. Fixes: http://tracker.ceph.com/issues/22227 Signed-off-by: Kefu Chai (cherry picked from commit 1f9e54ea00d6e31136a8157b96bc0cbf70301961) --- diff --git a/src/auth/KeyRing.cc b/src/auth/KeyRing.cc index 7f207d8fa53..41e440455c2 100644 --- a/src/auth/KeyRing.cc +++ b/src/auth/KeyRing.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include "auth/KeyRing.h" #include "common/ceph_context.h" #include "common/config.h" @@ -255,6 +256,7 @@ void KeyRing::print(ostream& out) string caps; using ceph::decode; decode(caps, dataiter); + boost::replace_all(caps, "\"", "\\\""); out << "\tcaps " << q->first << " = \"" << caps << '"' << std::endl; } }