From: Vikhyat Umrao Date: Thu, 5 Sep 2019 23:39:51 +0000 (-0700) Subject: radosgw-admin: add --uid check in bucket list command X-Git-Tag: v14.2.5~228^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e2db5a773b0dab0823c199e4d813080edd6b51e1;p=ceph.git radosgw-admin: add --uid check in bucket list command Fixes: https://tracker.ceph.com/issues/41589 Signed-off-by: Vikhyat Umrao (cherry picked from commit c53597b561837340314f0a169f6881c1814ce0b9) Conflicts: src/rgw/rgw_admin.cc - no --new-uid --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index da50a90a6e405..8c52dd15246de 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2897,6 +2897,10 @@ int main(int argc, const char **argv) break; } else if (ceph_argparse_witharg(args, i, &val, "-i", "--uid", (char*)NULL)) { user_id.from_str(val); + if (user_id.empty()) { + cerr << "no value for uid" << std::endl; + exit(1); + } } else if (ceph_argparse_witharg(args, i, &val, "--tenant", (char*)NULL)) { tenant = val; } else if (ceph_argparse_witharg(args, i, &val, "--access-key", (char*)NULL)) { @@ -5462,6 +5466,12 @@ int main(int argc, const char **argv) if (opt_cmd == OPT_BUCKETS_LIST) { if (bucket_name.empty()) { + if (!user_id.empty()) { + if (!user_op.has_existing_user()) { + cerr << "ERROR: could not find user: " << user_id << std::endl; + return -ENOENT; + } + } RGWBucketAdminOp::info(store, bucket_op, f); } else { RGWBucketInfo bucket_info;