summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-19 08:29:53 -0800
committerSage Weil <sage@inktank.com>2013-02-19 08:29:53 -0800
commit30b8d653751acb4bc4be5ca611f154e19afe910a (patch)
treebafb254c965c3d6737f99c1411470e1c808d9ad4
parent8e0be548579a50e006661a338a58aba66e342051 (diff)
downloadceph-30b8d653751acb4bc4be5ca611f154e19afe910a.tar.gz
mon: restrict pool size to 1..10
See: #4159 Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/mon/OSDMonitor.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 9c094307e4c..0198c29e45b 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;