From: Matt Benjamin Date: Wed, 16 May 2018 17:04:55 +0000 (-0400) Subject: rgw: require --yes-i-really-mean-it to run radosgw-admin orphans find X-Git-Tag: v12.2.8~83^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6100366f85b6c466a65f080cbbd77d2d8a4ef764;p=ceph.git rgw: require --yes-i-really-mean-it to run radosgw-admin orphans find Incorrect use of orphans find can lead to data loss. Warn users to be extra cautious. Fixes: http://tracker.ceph.com/issues/24146 Signed-off-by: Matt Benjamin (cherry picked from commit 3ff47c7f3eb5964464c8cd49144546ce532ed7f7) --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 350875984125..5d571e217cff 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -6229,6 +6229,13 @@ next: } if (opt_cmd == OPT_ORPHANS_FIND) { + if (!yes_i_really_mean_it) { + cerr << "accidental removal of active objects can not be reversed; " + << "do you really mean it? (requires --yes-i-really-mean-it)" + << std::endl; + return EINVAL; + } + RGWOrphanSearch search(store, max_concurrent_ios, orphan_stale_secs); if (job_id.empty()) {