From: Sage Weil Date: Tue, 19 Feb 2013 16:29:53 +0000 (-0800) Subject: mon: restrict pool size to 1..10 X-Git-Tag: v0.59~170^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30b8d653751acb4bc4be5ca611f154e19afe910a;p=ceph.git mon: restrict pool size to 1..10 See: #4159 Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9c094307e4cc..0198c29e45b3 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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;