Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for v0.67.3 #202

Open
wants to merge 7 commits into
base: origin-v0.67.3-1733936726
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
478 changes: 478 additions & 0 deletions src/mon/MonCap.cc.orig

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion src/mon/Monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,19 @@ void Monitor::handle_command(MMonCommand *m)
return;
}

cmd_getval(g_ceph_context, cmdmap, "prefix", prefix);
// check return value. If no prefix parameter provided,
// return value will be false, then return error info.
if(!cmd_getval(g_ceph_context, cmdmap, "prefix", prefix)) {
reply_command(op, -EINVAL, "command prefix not found", 0);
return;
}

// check prefix is empty
if (prefix.empty()) {
reply_command(op, -EINVAL, "command prefix must not be empty", 0);
return;
}

if (prefix == "get_command_descriptions") {
int cmdnum = 0;
Formatter *f = new_formatter("json");
Expand Down Expand Up @@ -1985,6 +1997,15 @@ void Monitor::handle_command(MMonCommand *m)
boost::scoped_ptr<Formatter> f(new_formatter(format));

get_str_vec(prefix, fullcmd);

// make sure fullcmd is not empty.
// invalid prefix will cause empty vector fullcmd.
// such as, prefix=";,,;"
if (fullcmd.empty()) {
reply_command(op, -EINVAL, "command requires a prefix to be valid", 0);
return;
}

module = fullcmd[0];

access_cmd = _allowed_command(session, cmdmap);
Expand Down
Loading