]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix Host->bucket fallback logic inversion 10873/head
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 25 Aug 2016 15:04:34 +0000 (08:04 -0700)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 25 Aug 2016 15:04:34 +0000 (08:04 -0700)
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 <robin.johnson@dreamhost.com>
src/rgw/rgw_rest.cc

index fc5b2f9c8e8e214c37d3a4acd3722422e8f26f0b..632cbded6641a1c5bdc8dbe3f9fb4a2e1c00204f 100644 (file)
@@ -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;
     }