From: Robin H. Johnson Date: Thu, 25 Aug 2016 15:04:34 +0000 (-0700) Subject: rgw: Fix Host->bucket fallback logic inversion X-Git-Tag: v11.0.1~257^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0e0a4bc3dcb61c2e8dfe65daefe207c62b36306c;p=ceph.git rgw: Fix Host->bucket fallback logic inversion The logic (added in 46aae19ee) for falling back to just using the hostname as the possible bucket name contained an accidental inversion, because RGWHandler_REST::validate_bucket_name returns success as zero. Backport: jewel Fixes: http://tracker.ceph.com/issues/17136 Re-Fixes: http://tracker.ceph.com/issues/15975 Signed-off-by: Robin H. Johnson --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index fc5b2f9c8e8e..632cbded6641 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1825,7 +1825,7 @@ int RGWREST::preprocess(struct req_state *s, RGWClientIO* cio) if (subdomain.empty() && (domain.empty() || domain != info.host) && !looks_like_ip_address(info.host.c_str()) - && RGWHandler_REST::validate_bucket_name(info.host)) { + && RGWHandler_REST::validate_bucket_name(info.host) == 0) { subdomain.append(info.host); in_hosted_domain = 1; }