]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/KeyRing: escape quotes around commands 28740/head
authorKefu Chai <kchai@redhat.com>
Tue, 18 Jun 2019 14:02:57 +0000 (22:02 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 25 Jun 2019 12:24:27 +0000 (14:24 +0200)
so the exported auth can be re-imported.

Fixes: http://tracker.ceph.com/issues/22227
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 1f9e54ea00d6e31136a8157b96bc0cbf70301961)

src/auth/KeyRing.cc

index 7f207d8fa538ed229e31ec7daa7012bcb78be58e..41e440455c283ecb48dcd1cf1898786541c81196 100644 (file)
@@ -17,6 +17,7 @@
 #include <memory>
 #include <sstream>
 #include <algorithm>
+#include <boost/algorithm/string/replace.hpp>
 #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;
     }
   }