From b55f3dbbfe882ffef12e54ba4a52bc84f11f3a19 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Tue, 14 Apr 2015 18:31:18 -0700 Subject: [PATCH] rgw: Document a lurking problem I see with subdomain/domain splitting Signed-off-by: Robin H. Johnson --- src/rgw/rgw_rest.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 169b5baf557a..6fbe937331aa 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -198,6 +198,15 @@ void rgw_rest_init(CephContext *cct, RGWRegion& region) hostnames_set.insert(cct->_conf->rgw_dns_name); } hostnames_set.insert(region.hostnames.begin(), region.hostnames.end()); + /* TODO: We should have a sanity check that no hostname matches the end of + * any other hostname, otherwise we will get ambigious results from + * rgw_find_host_in_domains. + * Eg: + * Hostnames: [A, B.A] + * Inputs: [Z.A, X.B.A] + * Z.A clearly splits to subdomain=Z, domain=Z + * X.B.A ambigously splits to both {X, B.A} and {X.B, A} + */ } static bool str_ends_with(const string& s, const string& suffix, size_t *pos) -- 2.47.3