From: Robin H. Johnson Date: Wed, 15 Apr 2015 01:31:18 +0000 (-0700) Subject: rgw: Document a lurking problem I see with subdomain/domain splitting X-Git-Tag: v9.0.1~130^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b55f3dbbfe882ffef12e54ba4a52bc84f11f3a19;p=ceph.git rgw: Document a lurking problem I see with subdomain/domain splitting Signed-off-by: Robin H. Johnson --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 169b5baf557..6fbe937331a 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)