]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: restrict pool size to 1..10
authorSage Weil <sage@inktank.com>
Tue, 19 Feb 2013 16:29:53 +0000 (08:29 -0800)
committerSage Weil <sage@inktank.com>
Tue, 19 Feb 2013 16:29:53 +0000 (08:29 -0800)
See: #4159
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/OSDMonitor.cc

index 9c094307e4cc6bbfdbb7ec7b4b12856617c820b7..0198c29e45b377810c757b4f9d8a5d65878053f0 100644 (file)
@@ -3013,6 +3013,11 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
          unsigned n = strtol(start, &end, 10);
          if (*end == '\0') {
            if (m->cmd[4] == "size") {
+             if (n == 0 || n > 10) {
+               ss << "pool size must be between 1 and 10";
+               err = -EINVAL;
+               goto out;
+             }
              if (pending_inc.new_pools.count(pool) == 0)
                pending_inc.new_pools[pool] = *p;
              pending_inc.new_pools[pool].size = n;