Skip to content

Commit

Permalink
rgw: Fix Host->bucket fallback logic inversion
Browse files Browse the repository at this point in the history
The logic (added in 46aae19) 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 <robin.johnson@dreamhost.com>
(cherry picked from commit 70e0289)
  • Loading branch information
Robin H. Johnson authored and Abhishek Varshney committed Nov 3, 2016
1 parent 7b3ec11 commit b72fc1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rgw/rgw_rest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,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;
}
Expand Down

0 comments on commit b72fc1b

Please sign in to comment.