]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: disallow "all" as a key or value name
authorDouglas Fuller <dfuller@redhat.com>
Mon, 13 Nov 2017 22:31:34 +0000 (17:31 -0500)
committerDouglas Fuller <dfuller@redhat.com>
Tue, 14 Nov 2017 15:48:23 +0000 (10:48 -0500)
This avoids conflict with the wildcard "all" used for
OSD auth caps.

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
src/mon/OSDMonitor.cc

index b71a682a806dc3bee07423e488c477d364e7e96d..ec69c16ba7395d0f3d3e9f09156480be1d253e39 100644 (file)
@@ -6157,6 +6157,20 @@ int OSDMonitor::prepare_command_pool_application(const string &prefix,
   cmd_getval(cct, cmdmap, "app", app);
   bool app_exists = (p.application_metadata.count(app) > 0);
 
+  string key;
+  cmd_getval(cct, cmdmap, "key", key);
+  if (key == "all") {
+    ss << "key cannot be 'all'";
+    return -EINVAL;
+  }
+
+  string value;
+  cmd_getval(cct, cmdmap, "value", value);
+  if (value == "all") {
+    ss << "value cannot be 'all'";
+    return -EINVAL;
+  }
+
   if (boost::algorithm::ends_with(prefix, "enable")) {
     if (app.empty()) {
       ss << "application name must be provided";