The monitor is not always the same version as the daemons, so it may
not always treat the caps the same. This parsing is also quite cpu
intensive, and is just a usability feature here - it's checked again
on the relevant daemon when the entity connects. Thus, provide an
option to disable this parsing. Leave it on by default for better
usability.
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
.add_service("mon")
.set_description("Timeout (in seconds) for smarctl to run, default is set to 5"),
+ Option("mon_auth_validate_all_caps", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+ .set_default(true)
+ .add_service("mon")
+ .set_description("Whether to parse non-monitor capabilities set by the "
+ "'ceph auth ...' commands. Disabling this saves CPU on the "
+ "monitor, but allows invalid capabilities to be set, and "
+ "only be rejected later, when they are used.")
+ .set_flag(Option::FLAG_RUNTIME),
// PAXOS
if (!moncap.parse(caps, out)) {
return false;
}
- } else if (type == "mgr") {
+ return true;
+ }
+
+ if (!g_conf().get_val<bool>("mon_auth_validate_all_caps")) {
+ return true;
+ }
+
+ if (type == "mgr") {
MgrCap mgrcap;
if (!mgrcap.parse(caps, out)) {
return false;