Fixes: #7064
Instead of trying to access the object, which is impossible as we don't
even have a proper bucket info. Up until now we ended up creating an
empty pool and eventually returning ENOENT, this fix catches the issue
earlier in the process.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
}
}
- if (s->bucket_name_str.size()) {
+ if (!s->bucket_name_str.empty()) {
s->bucket_exists = true;
if (s->bucket_instance_id.empty()) {
ret = store->get_bucket_info(s->obj_ctx, s->bucket_name_str, s->bucket_info, NULL, &s->bucket_attrs);
/* we're passed only_bucket = true when we specifically need the bucket's
acls, that happens on write operations */
- if (!only_bucket) {
+ if (!only_bucket && !s->object_str.empty()) {
+ if (!s->bucket_exists) {
+ return -ERR_NO_SUCH_BUCKET;
+ }
s->object_acl = new RGWAccessControlPolicy(s->cct);
obj_str = s->object_str;