From: Kefu Chai Date: Tue, 18 Jun 2019 14:02:57 +0000 (+0800) Subject: auth/KeyRing: escape quotes around commands X-Git-Tag: v12.2.13~171^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=83ef20b89eb38a8c0e8cf31e796f88d2b7252182;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) Conflicts: src/auth/KeyRing.cc - namespace refactor took place post-luminous --- diff --git a/src/auth/KeyRing.cc b/src/auth/KeyRing.cc index b946a298b48..22d8dead294 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) bufferlist::iterator dataiter = q->second.begin(); string caps; ::decode(caps, dataiter); + boost::replace_all(caps, "\"", "\\\""); out << "\tcaps " << q->first << " = \"" << caps << '"' << std::endl; } }