]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: check legal input for zone modify command
authorOrit Wasserman <owasserm@redhat.com>
Wed, 14 Oct 2015 13:47:19 +0000 (15:47 +0200)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:10 +0000 (16:13 -0800)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_admin.cc

index de0dea3cdadc11e5e0913d88c13fb23d12b85d5e..44bd31cf951c578182911d3b5c1a4a98b4a28d43 100644 (file)
@@ -2828,6 +2828,16 @@ int main(int argc, char **argv)
       break;
     case OPT_ZONE_MODIFY:
       {
+       if (zone_id.empty() && zone_name.empty()) {
+         cerr << "no zone name or id provided" << std::endl;
+         return -EINVAL;
+       }
+
+       if (zonegroup_id.empty() && zonegroup_name.empty()) {
+         cerr << "no zonegroup name or id provided" << std::endl;
+         return -EINVAL;
+       }
+
        RGWZoneParams zone(zone_id, zone_name);
        int ret = zone.init(g_ceph_context, store);
         if (ret < 0) {