summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-11-22 18:00:39 +0000
committerJoao Eduardo Luis <joao.luis@inktank.com>2014-03-18 16:35:59 +0000
commit01a0f2d3b7da523e09881f9134e07c1c1caeda02 (patch)
tree29e4cc46a072ebf07f3aa5325a196b506e8bf905
parent074c880830d1eedf67d36b22596ddaeda539f7ec (diff)
downloadceph-01a0f2d3b7da523e09881f9134e07c1c1caeda02.tar.gz
mon: OSDMonitor: don't rely on client-side validation for command arguments
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/OSDMonitor.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index e757cfd798b..a3ec269dcef 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -3798,7 +3798,11 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
newcrush.set_tunables_optimal();
} else if (profile == "default") {
newcrush.set_tunables_default();
- }
+ } else {
+ ss << "unrecognized profile '" << profile << "'";
+ err = -EINVAL;
+ goto reply;
+ }
pending_inc.crush.clear();
newcrush.encode(pending_inc.crush);
ss << "adjusted tunables profile to " << profile;
@@ -3992,6 +3996,10 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
return prepare_set_flag(m, CEPH_OSDMAP_NODEEP_SCRUB);
else if (key == "notieragent")
return prepare_set_flag(m, CEPH_OSDMAP_NOTIERAGENT);
+ else {
+ ss << "unrecognized flag '" << key << "'";
+ err = -EINVAL;
+ }
} else if (prefix == "osd unset") {
string key;
@@ -4016,6 +4024,10 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
return prepare_unset_flag(m, CEPH_OSDMAP_NODEEP_SCRUB);
else if (key == "notieragent")
return prepare_unset_flag(m, CEPH_OSDMAP_NOTIERAGENT);
+ else {
+ ss << "unrecognized flag '" << key << "'";
+ err = -EINVAL;
+ }
} else if (prefix == "osd cluster_snap") {
// ** DISABLE THIS FOR NOW **