]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw-admin: check input parameters for friendly prompt. 17343/head
authorYao Zongyou <yaozongyou@vip.qq.com>
Tue, 29 Aug 2017 13:05:20 +0000 (21:05 +0800)
committerYao Zongyou <yaozongyou@vip.qq.com>
Tue, 29 Aug 2017 13:05:20 +0000 (21:05 +0800)
Signed-off-by: Yao Zongyou <yaozongyou@vip.qq.com>
src/rgw/rgw_admin.cc

index 840878040926a3ba21637e6c12ec423fffcf8fea..66911b9daa64ee50b804d1ffb8b6dd246b6fd4a6 100644 (file)
@@ -5284,6 +5284,14 @@ next:
   }
 
   if (opt_cmd == OPT_BI_GET) {
+    if (bucket_name.empty()) {
+      cerr << "ERROR: bucket name not specified" << std::endl;
+      return EINVAL;
+    }
+    if (object.empty()) {
+      cerr << "ERROR: object not specified" << std::endl;
+      return EINVAL;
+    }
     RGWBucketInfo bucket_info;
     int ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket);
     if (ret < 0) {
@@ -5308,6 +5316,10 @@ next:
   }
 
   if (opt_cmd == OPT_BI_PUT) {
+    if (bucket_name.empty()) {
+      cerr << "ERROR: bucket name not specified" << std::endl;
+      return EINVAL;
+    }
     RGWBucketInfo bucket_info;
     int ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket);
     if (ret < 0) {