]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: require bucket name in bucket chown 41765/head
authorZulai Wang <zl31wang@gmail.com>
Thu, 3 Jun 2021 05:13:15 +0000 (13:13 +0800)
committerCory Snyder <csnyder@iland.com>
Tue, 8 Jun 2021 18:06:10 +0000 (14:06 -0400)
Checking and reporting missing the mandatory parameter avoid clueless error
message for bucket chown.

Signed-off-by: Zulai Wang <zl31wang@gmail.com>
(cherry picked from commit 158a1f4313c0fa206031ede6f48a26c0c7467d57)

src/rgw/rgw_admin.cc

index 5bd78a668e995237b2876b7e69c484c77d7cdbdd..a922182571d0bd324964442d8aaeb62635b016ce 100644 (file)
@@ -6171,6 +6171,10 @@ int main(int argc, const char **argv)
   }
 
   if (opt_cmd == OPT::BUCKET_CHOWN) {
+    if (bucket_name.empty()) {
+      cerr << "ERROR: bucket name not specified" << std::endl;
+      return EINVAL;
+    }
 
     bucket_op.set_bucket_name(bucket_name);
     bucket_op.set_new_bucket_name(new_bucket_name);