From: Kefu Chai Date: Tue, 18 Jun 2019 14:02:57 +0000 (+0800) Subject: auth/KeyRing: escape quotes around commands X-Git-Tag: v13.2.7~241^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6cfcf730199105dd4ed65047cdb2d95202c38aea;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 832cae0a346b..3913a8cc65e6 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/config.h" #include "common/debug.h" @@ -256,6 +257,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; } }