]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: require bucket name in bucket chown 41668/head
authorZulai Wang <zl31wang@gmail.com>
Thu, 3 Jun 2021 05:13:15 +0000 (13:13 +0800)
committerZulai Wang <zl31wang@gmail.com>
Thu, 3 Jun 2021 05:41:07 +0000 (13:41 +0800)
Checking and reporting missing the mandatory parameter avoid clueless error
message for bucket chown.

Signed-off-by: Zulai Wang <zl31wang@gmail.com>
src/rgw/rgw_admin.cc

index 707378ff823c6f8c293b86281a337c9a382ac54c..99f7656971aea9bc9f366da4be25174bb682addb 100644 (file)
@@ -6196,6 +6196,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);