summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Benjamin <mbenjamin@redhat.com>2019-05-30 17:15:23 +0200
committerMatt Benjamin <mbenjamin@redhat.com>2019-05-30 20:39:04 +0200
commit974791522007cca6d8fb30e83677f0ddd7c4e71d (patch)
tree35c6c5a49e5ff27bacc983a7a205556a3a078cd3
parentMerge pull request #27806 from ashitakasam/add-osd-alarm (diff)
downloadceph-974791522007cca6d8fb30e83677f0ddd7c4e71d.tar.xz
ceph-974791522007cca6d8fb30e83677f0ddd7c4e71d.zip
rgw: conditionally allow non-unique email addresses
Conditionally allow non-unique email address values for builtin RGW users. Fixes: http://tracker.ceph.com/issues/40089 Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
-rw-r--r--src/common/options.cc8
-rw-r--r--src/rgw/rgw_user.cc8
2 files changed, 13 insertions, 3 deletions
diff --git a/src/common/options.cc b/src/common/options.cc
index d4720f133c8..596a3625257 100644
--- a/src/common/options.cc
+++ b/src/common/options.cc
@@ -6581,6 +6581,14 @@ std::vector<Option> get_rgw_options() {
"server static websites if s3website hostnames are configured, and unrelated to "
"this configurable."),
+ Option("rgw_user_unique_email", Option::TYPE_BOOL, Option::LEVEL_BASIC)
+ .set_default(true)
+ .set_description("Require local RGW users to have unique email addresses")
+ .set_long_description(
+ "Enforce builtin user accounts to have unique email addresses. This "
+ "setting is historical. In future, non-enforcement of email address "
+ "uniqueness is likely to become the default."),
+
Option("rgw_log_http_headers", Option::TYPE_STR, Option::LEVEL_BASIC)
.set_default("")
.set_description("List of HTTP headers to log")
diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc
index 0eb06ce7578..0154dae55f0 100644
--- a/src/rgw/rgw_user.cc
+++ b/src/rgw/rgw_user.cc
@@ -1804,9 +1804,11 @@ int RGWUser::init(RGWUserAdminOpState& op_state)
found = (rgw_get_user_info_by_uid(store, user_id, user_info, &op_state.objv) >= 0);
op_state.found_by_uid = found;
}
- if (!user_email.empty() && !found) {
- found = (rgw_get_user_info_by_email(store, user_email, user_info, &op_state.objv) >= 0);
- op_state.found_by_email = found;
+ if (store->ctx()->_conf.get_val<bool>("rgw_user_unique_email")) {
+ if (!user_email.empty() && !found) {
+ found = (rgw_get_user_info_by_email(store, user_email, user_info, &op_state.objv) >= 0);
+ op_state.found_by_email = found;
+ }
}
if (!swift_user.empty() && !found) {
found = (rgw_get_user_info_by_swift(store, swift_user, user_info, &op_state.objv) >= 0);