]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/KeyRing: escape quotes around commands 28742/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:29:11 +0000 (14:29 +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)

Conflicts:
src/auth/KeyRing.cc
- namespace refactor took place post-luminous

src/auth/KeyRing.cc

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