From: John Spray Date: Mon, 12 Jan 2015 14:52:43 +0000 (+0000) Subject: mon/MDSMonitor: add confirm flag to fs reset X-Git-Tag: v0.92~27^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4152dbfa1bc7c75fbe1baea273a9c42a87e1b3f;p=ceph.git mon/MDSMonitor: add confirm flag to fs reset This was already in the command map but was not being checked. Signed-off-by: John Spray --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 9ee5958d8b5..394793a22a8 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1228,6 +1228,15 @@ int MDSMonitor::management_command( return -EINVAL; } + // Check for confirmation flag + string sure; + cmd_getval(g_ceph_context, cmdmap, "sure", sure); + if (sure != "--yes-i-really-mean-it") { + ss << "this is a potentially destructive operation, only for use by experts in disaster recovery. " + "Add --yes-i-really-mean-it if you are sure you wish to continue."; + return -EPERM; + } + MDSMap newmap; // Populate rank 0 as existing (so don't go into CREATING)