summaryrefslogtreecommitdiffstats
path: root/src/rgw/driver/rados/rgw_user.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rgw/driver/rados/rgw_user.cc')
-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;