Skip to content

Commit

Permalink
radosgw-admin: add --uid check in bucket list command
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/41589

Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
(cherry picked from commit c53597b)

 Conflicts:
	src/rgw/rgw_admin.cc
        - no --new-uid
  • Loading branch information
vumrao committed Sep 26, 2019
1 parent 534c2f1 commit e2db5a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/rgw/rgw_admin.cc
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e2db5a7

Please sign in to comment.