From 886bc940d2b7c390fbc2d384b2f152e4401384b9 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 18 Jun 2019 22:02:57 +0800 Subject: [PATCH] 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) --- src/auth/KeyRing.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/auth/KeyRing.cc b/src/auth/KeyRing.cc index 7f207d8fa538e..41e440455c283 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; } }