(Acked by Daniel.) Now with less use-after-free.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
return ret;
}
+ // XXXX currently, rgw::sal::Bucket.owner is always null here
+ std::unique_ptr<rgw::sal::User> user;
+ if (! bucket->get_owner()) {
+ auto& bucket_info = bucket->get_info();
+ user = store->get_user(bucket_info.owner);
+ // forgive me, lord
+ if (user) {
+ bucket->set_owner(user.get());
+ }
+ }
+
obj = bucket->get_object(obj_key);
std::unique_ptr<rgw::sal::Object::DeleteOp> del_op
= obj->get_delete_op(&oc.rctx);
virtual RGWAccessControlPolicy& get_acl(void) = 0;
/** Set the ACL for this bucket */
virtual int set_acl(const DoutPrefixProvider* dpp, RGWAccessControlPolicy& acl, optional_yield y) = 0;
+
+ // XXXX hack
+ void set_owner(rgw::sal::User* _owner) {
+ owner = _owner;
+ }
+
/** Load this bucket from the backing store. Requires the key to be set, fills other fields */
virtual int load_bucket(const DoutPrefixProvider* dpp, optional_yield y) = 0;
/** Read the bucket stats from the backing Store, synchronous */