we should have already looked up s->bucket and s->object during auth
since s->object may store a raw pointer to s->bucket before this,
overwriting s->bucket here would leave a dangling pointer and Object's
operator<<() would crash
Fixes: https://tracker.ceph.com/issues/51491
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit
2598e062d04d7fe4477aa096c19ebebfa77d19ea)
if (!(s->prot_flags & RGW_REST_WEBSITE))
return 0;
- int ret = store->get_bucket(s, nullptr, s->bucket_tenant, s->bucket_name, &s->bucket, y);
- if (ret < 0) {
- // TODO-FUTURE: if the bucket does not exist, maybe expose it here?
- return -ERR_NO_SUCH_BUCKET;
- }
-
- s->bucket_attrs = s->bucket->get_attrs();
-
if (!s->bucket->get_info().has_website) {
// TODO-FUTURE: if the bucket has no WebsiteConfig, expose it here
return -ERR_NO_SUCH_WEBSITE_CONFIGURATION;