summaryrefslogtreecommitdiffstats
path: root/src/rgw/driver/rados
diff options
context:
space:
mode:
authorCasey Bodley <cbodley@redhat.com>2024-11-25 19:07:46 +0100
committerCasey Bodley <cbodley@redhat.com>2024-11-25 19:07:50 +0100
commit5378cfe3c5bf5953b53beee42975d045759238b1 (patch)
tree128cb23a66b7256d81b7181f05787d47349c9cf8 /src/rgw/driver/rados
parentMerge pull request #60813 from anthonyeleven/improve-subsystem (diff)
downloadceph-5378cfe3c5bf5953b53beee42975d045759238b1.tar.xz
ceph-5378cfe3c5bf5953b53beee42975d045759238b1.zip
radosgw-admin: 'user create' rejects uids matching the account id format
`parse_owner()` relies on `rgw::account::validate_id()` to disambiguate between user ids and account ids. reject attempts to create a user with an ambiguous user id Fixes: https://tracker.ceph.com/issues/69043 Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/driver/rados')
-rw-r--r--src/rgw/driver/rados/rgw_user.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rgw/driver/rados/rgw_user.cc b/src/rgw/driver/rados/rgw_user.cc
index 94a18ffcbab..894d8e40950 100644
--- a/src/rgw/driver/rados/rgw_user.cc
+++ b/src/rgw/driver/rados/rgw_user.cc
@@ -1755,7 +1755,11 @@ int RGWUser::execute_add(const DoutPrefixProvider *dpp, RGWUserAdminOpState& op_
user_info.display_name = display_name;
user_info.type = TYPE_RGW;
- // tenant must not look like a valid account id
+ // user/tenant must not look like a valid account id
+ if (rgw::account::validate_id(uid.id)) {
+ set_err_msg(err_msg, "uid must not be formatted as an account id");
+ return -EINVAL;
+ }
if (rgw::account::validate_id(uid.tenant)) {
set_err_msg(err_msg, "tenant must not be formatted as an account id");
return -EINVAL;