Chown was not unlinking, and was partially leaving the ownership wrong.
Fix this by reworking chown. Bucket::chown now just changes ownership
of the bucket from it's previous owner to a new one. An Object::chown
was added to change the ownership of an object. The chown admin API was
modified to loop through all the objects in a bucket, changing the
ownership, so that a normal Bucket::chown doesn't need to do that
anymore.
Fixes https://tracker.ceph.com/issues/57936
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
#include <map>
#include "rgw_sal_store.h"
#include "rgw_common.h"
-#include "rgw_bucket.h"
+#include "driver/rados/rgw_bucket.h"
#include "global/global_context.h"
#include "global/global_init.h"
#include "common/ceph_context.h"
}
}
-void check_bad_user_bucket_mapping(rgw::sal::Driver* driver, rgw::sal::User* user,
+void check_bad_user_bucket_mapping(rgw::sal::Driver* driver, rgw::sal::User& user,
bool fix,
optional_yield y,
const DoutPrefixProvider *dpp)
size_t max_entries = cct->_conf->rgw_list_buckets_max_chunk;
do {
- int ret = user->list_buckets(dpp, marker, string(), max_entries, false, user_buckets, y);
+ int ret = user.list_buckets(dpp, marker, string(), max_entries, false, user_buckets, y);
if (ret < 0) {
ldout(driver->ctx(), 0) << "failed to read user buckets: "
<< cpp_strerror(-ret) << dendl;
auto& bucket = i->second;
std::unique_ptr<rgw::sal::Bucket> actual_bucket;
- int r = driver->get_bucket(dpp, user, user->get_tenant(), bucket->get_name(), &actual_bucket, null_yield);
+ int r = driver->get_bucket(dpp, &user, user.get_tenant(), bucket->get_name(), &actual_bucket, null_yield);
if (r < 0) {
ldout(driver->ctx(), 0) << "could not get bucket info for bucket=" << bucket << dendl;
continue;
cout << "bucket info mismatch: expected " << actual_bucket << " got " << bucket << std::endl;
if (fix) {
cout << "fixing" << std::endl;
- r = actual_bucket->chown(dpp, user, nullptr, null_yield);
+ r = actual_bucket->chown(dpp, user, null_yield);
if (r < 0) {
cerr << "failed to fix bucket: " << cpp_strerror(-r) << std::endl;
}
int RGWBucket::chown(RGWBucketAdminOpState& op_state, const string& marker,
optional_yield y, const DoutPrefixProvider *dpp, std::string *err_msg)
{
- int ret = bucket->chown(dpp, user.get(), user.get(), y, &marker);
- if (ret < 0) {
- set_err_msg(err_msg, "Failed to change object ownership: " + cpp_strerror(-ret));
- }
-
- return ret;
+ /* User passed in by rgw_admin is the new user; get the current user and set it in
+ * the bucket */
+ std::unique_ptr<rgw::sal::User> old_user = driver->get_user(bucket->get_info().owner);
+ bucket->set_owner(old_user.get());
+
+ return rgw_chown_bucket_and_objects(driver, bucket.get(), user.get(), marker, err_msg, dpp, y);
}
int RGWBucket::set_quota(RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, std::string *err_msg)
return svc.bucket->store_bucket_entrypoint_info(ctx, meta_key, ep, false, real_time(), &attrs, &ot, y, dpp);
}
-// TODO: remove RGWRados dependency for bucket listing
-int RGWBucketCtl::chown(rgw::sal::Driver* driver, rgw::sal::Bucket* bucket,
- const rgw_user& user_id, const std::string& display_name,
- const std::string& marker, optional_yield y, const DoutPrefixProvider *dpp)
-{
- map<string, bool> common_prefixes;
-
- rgw::sal::Bucket::ListParams params;
- rgw::sal::Bucket::ListResults results;
-
- params.list_versions = true;
- params.allow_unordered = true;
- params.marker = marker;
-
- int count = 0;
- int max_entries = 1000;
-
- //Loop through objects and update object acls to point to bucket owner
-
- do {
- RGWObjectCtx obj_ctx(driver);
- results.objs.clear();
- int ret = bucket->list(dpp, params, max_entries, results, y);
- if (ret < 0) {
- ldpp_dout(dpp, 0) << "ERROR: list objects failed: " << cpp_strerror(-ret) << dendl;
- return ret;
- }
-
- params.marker = results.next_marker;
- count += results.objs.size();
-
- for (const auto& obj : results.objs) {
- std::unique_ptr<rgw::sal::Object> r_obj = bucket->get_object(obj.key);
-
- ret = r_obj->get_obj_attrs(y, dpp);
- if (ret < 0){
- ldpp_dout(dpp, 0) << "ERROR: failed to read object " << obj.key.name << cpp_strerror(-ret) << dendl;
- continue;
- }
- const auto& aiter = r_obj->get_attrs().find(RGW_ATTR_ACL);
- if (aiter == r_obj->get_attrs().end()) {
- ldpp_dout(dpp, 0) << "ERROR: no acls found for object " << obj.key.name << " .Continuing with next object." << dendl;
- continue;
- } else {
- bufferlist& bl = aiter->second;
- RGWAccessControlPolicy policy(driver->ctx());
- ACLOwner owner;
- try {
- decode(policy, bl);
- owner = policy.get_owner();
- } catch (buffer::error& err) {
- ldpp_dout(dpp, 0) << "ERROR: decode policy failed" << err.what()
- << dendl;
- return -EIO;
- }
-
- //Get the ACL from the policy
- RGWAccessControlList& acl = policy.get_acl();
-
- //Remove grant that is set to old owner
- acl.remove_canon_user_grant(owner.get_id());
-
- //Create a grant and add grant
- ACLGrant grant;
- grant.set_canon(user_id, display_name, RGW_PERM_FULL_CONTROL);
- acl.add_grant(&grant);
-
- //Update the ACL owner to the new user
- owner.set_id(user_id);
- owner.set_name(display_name);
- policy.set_owner(owner);
-
- bl.clear();
- encode(policy, bl);
-
- r_obj->set_atomic();
- map<string, bufferlist> attrs;
- attrs[RGW_ATTR_ACL] = bl;
- ret = r_obj->set_obj_attrs(dpp, &attrs, nullptr, y);
- if (ret < 0) {
- ldpp_dout(dpp, 0) << "ERROR: modify attr failed " << cpp_strerror(-ret) << dendl;
- return ret;
- }
- }
- }
- cerr << count << " objects processed in " << bucket
- << ". Next marker " << params.marker.name << std::endl;
- } while(results.is_truncated);
- return 0;
-}
-
int RGWBucketCtl::read_bucket_stats(const rgw_bucket& bucket,
RGWBucketEnt *result,
optional_yield y,
#include "rgw_common.h"
#include "rgw_tools.h"
#include "rgw_metadata.h"
+#include "rgw/rgw_bucket.h"
#include "rgw_string.h"
#include "rgw_sal.h"
class RGWZone;
struct RGWZoneParams;
-extern void init_bucket(rgw_bucket *b, const char *t, const char *n, const char *dp, const char *ip, const char *m, const char *id);
-extern int rgw_bucket_parse_bucket_key(CephContext *cct, const std::string& key,
- rgw_bucket* bucket, int *shard_id);
-
-extern std::string rgw_make_bucket_entry_name(const std::string& tenant_name,
- const std::string& bucket_name);
-
-[[nodiscard]] int rgw_parse_url_bucket(const std::string& bucket,
- const std::string& auth_tenant,
- std::string &tenant_name,
- std::string &bucket_name);
-
// this is used as a filter to RGWRados::cls_bucket_list_ordered; it
// conforms to the type RGWBucketListNameFilter
extern bool rgw_bucket_object_check_filter(const std::string& oid);
const char* attr_name, bufferlist& out_bl,
optional_yield y);
-extern void check_bad_user_bucket_mapping(rgw::sal::Driver* driver, rgw::sal::User* user, bool fix, optional_yield y, const DoutPrefixProvider *dpp);
+extern void check_bad_user_bucket_mapping(rgw::sal::Driver* driver, rgw::sal::User& user, bool fix, optional_yield y, const DoutPrefixProvider *dpp);
struct RGWBucketAdminOpState {
rgw_user uid;
const DoutPrefixProvider *dpp,
bool update_entrypoint = true);
- int chown(rgw::sal::Driver* driver, rgw::sal::Bucket* bucket,
- const rgw_user& user_id, const std::string& display_name,
- const std::string& marker, optional_yield y, const DoutPrefixProvider *dpp);
-
int read_buckets_stats(std::map<std::string, RGWBucketEnt>& m,
optional_yield y,
const DoutPrefixProvider *dpp);
#include "services/svc_zone.h"
#include "services/svc_sync_modules.h"
-#include "rgw_bucket.h"
#include "include/common_fwd.h"
#include "include/random.h"
#include "rgw_sal_rados.h"
#include "rgw_bucket.h"
#include "rgw_multi.h"
+#include "rgw_acl.h"
#include "rgw_acl_s3.h"
#include "rgw_aio.h"
#include "rgw_aio_throttle.h"
return store->ctl()->bucket->unlink_bucket(new_user->get_id(), info.bucket, y, dpp, update_entrypoint);
}
-int RadosBucket::chown(const DoutPrefixProvider* dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker)
+int RadosBucket::chown(const DoutPrefixProvider* dpp, User& new_user, optional_yield y)
{
std::string obj_marker;
+ int r;
- if (marker == nullptr)
- marker = &obj_marker;
+ if (!owner) {
+ ldpp_dout(dpp, 0) << __func__ << " Cannot chown without an owner " << dendl;
+ return -EINVAL;
+ }
- int r = this->link(dpp, new_user, y);
+ r = this->unlink(dpp, owner, y);
if (r < 0) {
return r;
}
- if (!old_user) {
- return r;
- }
- return store->ctl()->bucket->chown(store, this, new_user->get_id(),
- old_user->get_display_name(), *marker, y, dpp);
+ return this->link(dpp, &new_user, y);
}
int RadosBucket::put_info(const DoutPrefixProvider* dpp, bool exclusive, ceph::real_time _mtime)
return sysobj.omap().set_must_exist(must_exist).set(dpp, key, val, y);
}
+int RadosObject::chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y)
+{
+ int r = get_obj_attrs(y, dpp);
+ if (r < 0) {
+ ldpp_dout(dpp, 0) << "ERROR: failed to read object attrs " << get_name() << cpp_strerror(-r) << dendl;
+ return r;
+ }
+
+ const auto& aiter = get_attrs().find(RGW_ATTR_ACL);
+ if (aiter == get_attrs().end()) {
+ ldpp_dout(dpp, 0) << "ERROR: no acls found for object " << get_name() << dendl;
+ return -EINVAL;
+ }
+
+ bufferlist& bl = aiter->second;
+ RGWAccessControlPolicy policy(store->ctx());
+ ACLOwner owner;
+ auto bliter = bl.cbegin();
+ try {
+ policy.decode(bliter);
+ owner = policy.get_owner();
+ } catch (buffer::error& err) {
+ ldpp_dout(dpp, 0) << "ERROR: decode policy failed" << err.what()
+ << dendl;
+ return -EIO;
+ }
+
+ //Get the ACL from the policy
+ RGWAccessControlList& acl = policy.get_acl();
+
+ //Remove grant that is set to old owner
+ acl.remove_canon_user_grant(owner.get_id());
+
+ //Create a grant and add grant
+ ACLGrant grant;
+ grant.set_canon(new_user.get_id(), new_user.get_display_name(), RGW_PERM_FULL_CONTROL);
+ acl.add_grant(&grant);
+
+ //Update the ACL owner to the new user
+ owner.set_id(new_user.get_id());
+ owner.set_name(new_user.get_display_name());
+ policy.set_owner(owner);
+
+ bl.clear();
+ encode(policy, bl);
+
+ set_atomic();
+ map<string, bufferlist> attrs;
+ attrs[RGW_ATTR_ACL] = bl;
+ r = set_obj_attrs(dpp, &attrs, nullptr, y);
+ if (r < 0) {
+ ldpp_dout(dpp, 0) << "ERROR: modify attr failed " << cpp_strerror(-r) << dendl;
+ return r;
+ }
+
+ return 0;
+}
+
std::unique_ptr<MPSerializer> RadosObject::get_serializer(const DoutPrefixProvider *dpp, const std::string& lock_name)
{
return std::make_unique<MPRadosSerializer>(dpp, store, this, lock_name);
Attrs* vals) override;
virtual int omap_set_val_by_key(const DoutPrefixProvider *dpp, const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) override;
+ virtual int chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y) override;
/* Internal to RadosStore */
int get_max_chunk_size(const DoutPrefixProvider* dpp,
virtual int sync_user_stats(const DoutPrefixProvider *dpp, optional_yield y) override;
virtual int update_container_stats(const DoutPrefixProvider* dpp) override;
virtual int check_bucket_shards(const DoutPrefixProvider* dpp) override;
- virtual int chown(const DoutPrefixProvider* dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker = nullptr) override;
+ virtual int chown(const DoutPrefixProvider* dpp, User& new_user, optional_yield y) override;
virtual int put_info(const DoutPrefixProvider* dpp, bool exclusive, ceph::real_time mtime) override;
virtual bool is_owner(User* user) override;
virtual int check_empty(const DoutPrefixProvider* dpp, optional_yield y) override;
return ret;
}
- ret = bucket->chown(dpp, new_user.get(), old_user.get(), y);
+ ret = rgw_chown_bucket_and_objects(driver, bucket.get(), new_user.get(),
+ std::string(), nullptr, dpp, y);
if (ret < 0) {
set_err_msg(err_msg, "failed to run bucket chown" + cpp_strerror(-ret));
return ret;
#include "include/str_list.h"
#include "rgw_user.h"
-#include "rgw_bucket.h"
#include "rgw_otp.h"
#include "rgw_rados.h"
#include "rgw_acl.h"
#include "services/svc_user.h"
#include "services/svc_zone.h"
+#include "driver/rados/rgw_bucket.h"
+
#define dout_context g_ceph_context
#define SECRET_KEY_LEN 40
}
if (opt_cmd == OPT::USER_CHECK) {
- check_bad_user_bucket_mapping(driver, user.get(), fix, null_yield, dpp());
+ check_bad_user_bucket_mapping(driver, *user.get(), fix, null_yield, dpp());
}
if (opt_cmd == OPT::USER_STATS) {
#include "rgw_bucket.h"
+#include "common/errno.h"
+
#define dout_subsys ceph_subsys_rgw
// stolen from src/cls/version/cls_version.cc
using namespace std;
+static void set_err_msg(std::string *sink, std::string msg)
+{
+ if (sink && !msg.empty())
+ *sink = msg;
+}
+
void init_bucket(rgw_bucket *b, const char *t, const char *n, const char *dp, const char *ip, const char *m, const char *id)
{
b->tenant = t;
return 0;
}
+int rgw_chown_bucket_and_objects(rgw::sal::Driver* driver, rgw::sal::Bucket* bucket,
+ rgw::sal::User* new_user,
+ const std::string& marker, std::string *err_msg,
+ const DoutPrefixProvider *dpp, optional_yield y)
+{
+ /* Chown on the bucket */
+ int ret = bucket->chown(dpp, *new_user, y);
+ if (ret < 0) {
+ set_err_msg(err_msg, "Failed to change object ownership: " + cpp_strerror(-ret));
+ }
+
+ /* Now chown on all the objects in the bucket */
+ map<string, bool> common_prefixes;
+
+ rgw::sal::Bucket::ListParams params;
+ rgw::sal::Bucket::ListResults results;
+
+ params.list_versions = true;
+ params.allow_unordered = true;
+ params.marker = marker;
+
+ int count = 0;
+ int max_entries = 1000;
+
+ //Loop through objects and update object acls to point to bucket owner
+
+ do {
+ results.objs.clear();
+ ret = bucket->list(dpp, params, max_entries, results, y);
+ if (ret < 0) {
+ ldpp_dout(dpp, 0) << "ERROR: list objects failed: " << cpp_strerror(-ret) << dendl;
+ return ret;
+ }
+
+ params.marker = results.next_marker;
+ count += results.objs.size();
+
+ for (const auto& obj : results.objs) {
+ std::unique_ptr<rgw::sal::Object> r_obj = bucket->get_object(obj.key);
+
+ ret = r_obj->chown(*new_user, dpp, y);
+ if (ret < 0) {
+ ldpp_dout(dpp, 0) << "ERROR: chown failed on " << r_obj << " :" << cpp_strerror(-ret) << dendl;
+ return ret;
+ }
+ }
+ cerr << count << " objects processed in " << bucket
+ << ". Next marker " << params.marker.name << std::endl;
+ } while(results.is_truncated);
+
+ return ret;
+}
+
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab ft=cpp
+
+#pragma once
+
+#include <string>
+#include <memory>
+#include <variant>
+
+#include <boost/container/flat_map.hpp>
+#include <boost/container/flat_set.hpp>
+
+#include "include/types.h"
+#include "rgw_common.h"
+#include "rgw_sal.h"
+
+extern void init_bucket(rgw_bucket *b, const char *t, const char *n, const char *dp, const char *ip, const char *m, const char *id);
+
+extern int rgw_bucket_parse_bucket_key(CephContext *cct, const std::string& key,
+ rgw_bucket* bucket, int *shard_id);
+
+extern std::string rgw_make_bucket_entry_name(const std::string& tenant_name,
+ const std::string& bucket_name);
+
+[[nodiscard]] int rgw_parse_url_bucket(const std::string& bucket,
+ const std::string& auth_tenant,
+ std::string &tenant_name,
+ std::string &bucket_name);
+
+extern int rgw_chown_bucket_and_objects(rgw::sal::Driver* driver,
+ rgw::sal::Bucket* bucket,
+ rgw::sal::User* new_user,
+ const std::string& marker,
+ std::string *err_msg,
+ const DoutPrefixProvider *dpp,
+ optional_yield y);
#include "rgw_acl.h"
#include "rgw_acl_s3.h" /* for dumping s3policy in debug log */
#include "rgw_aio_throttle.h"
-#include "rgw_bucket.h"
+#include "driver/rados/rgw_bucket.h"
#include "rgw_rest_conn.h"
#include "rgw_cr_rados.h"
#include "rgw_cr_rest.h"
#include <sstream>
#include "rgw_zone.h"
-#include "rgw_bucket.h"
+#include "driver/rados/rgw_bucket.h"
#include "rgw_reshard.h"
#include "rgw_sal.h"
#include "rgw_sal_rados.h"
// vim: ts=8 sw=2 smarttab ft=cpp
#include "rgw_op.h"
-#include "rgw_bucket.h"
+#include "driver/rados/rgw_bucket.h"
#include "rgw_rest_bucket.h"
#include "rgw_sal.h"
virtual int update_container_stats(const DoutPrefixProvider* dpp) = 0;
/** Check if this bucket needs resharding, and schedule it if it does */
virtual int check_bucket_shards(const DoutPrefixProvider* dpp) = 0;
- /** Change the owner of this bucket in the backing store */
- virtual int chown(const DoutPrefixProvider* dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker = nullptr) = 0;
+ /** Change the owner of this bucket in the backing store. Current owner must be set. Does not
+ * change ownership of the objects in the bucket. */
+ virtual int chown(const DoutPrefixProvider* dpp, User& new_user, optional_yield y) = 0;
/** Store the cached bucket info into the backing store */
virtual int put_info(const DoutPrefixProvider* dpp, bool exclusive, ceph::real_time mtime) = 0;
/** Check to see if the given user is the owner of this bucket */
/** Get a single OMAP value matching the given key */
virtual int omap_set_val_by_key(const DoutPrefixProvider *dpp, const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) = 0;
+ /** Change the ownership of this object */
+ virtual int chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y) = 0;
/** Check to see if the given object pointer is uninitialized */
static bool empty(const Object* o) { return (!o || o->empty()); }
return DAOS_NOT_IMPLEMENTED_LOG(dpp);
}
-int DaosBucket::chown(const DoutPrefixProvider* dpp, User* new_user,
- User* old_user, optional_yield y,
- const std::string* marker) {
- /* XXX: Update policies of all the bucket->objects with new user */
+int DaosBucket::chown(const DoutPrefixProvider* dpp, User& new_user,
+ optional_yield y) {
return DAOS_NOT_IMPLEMENTED_LOG(dpp);
}
return DAOS_NOT_IMPLEMENTED_LOG(dpp);
}
+int DaosObject::chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y) {
+ return 0;
+}
+
std::unique_ptr<MPSerializer> DaosObject::get_serializer(
const DoutPrefixProvider* dpp, const std::string& lock_name) {
return std::make_unique<MPDaosSerializer>(dpp, store, this, lock_name);
optional_yield y) override;
virtual int update_container_stats(const DoutPrefixProvider* dpp) override;
virtual int check_bucket_shards(const DoutPrefixProvider* dpp) override;
- virtual int chown(const DoutPrefixProvider* dpp, User* new_user,
- User* old_user, optional_yield y,
- const std::string* marker = nullptr) override;
+ virtual int chown(const DoutPrefixProvider* dpp, User& new_user,
+ optional_yield y) override;
virtual int put_info(const DoutPrefixProvider* dpp, bool exclusive,
ceph::real_time mtime) override;
virtual bool is_owner(User* user) override;
virtual int omap_set_val_by_key(const DoutPrefixProvider* dpp,
const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) override;
+ virtual int chown(User& new_user, const DoutPrefixProvider* dpp,
+ optional_yield y) override;
bool is_open() { return ds3o != nullptr; };
// Only lookup the object, do not create
return 0;
}
- int DBBucket::chown(const DoutPrefixProvider *dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker)
+ int DBBucket::chown(const DoutPrefixProvider *dpp, User& new_user, optional_yield y)
{
int ret;
- ret = store->getDB()->update_bucket(dpp, "owner", info, false, &(new_user->get_id()), nullptr, nullptr, nullptr);
-
- /* XXX: Update policies of all the bucket->objects with new user */
+ ret = store->getDB()->update_bucket(dpp, "owner", info, false, &(new_user.get_id()), nullptr, nullptr, nullptr);
return ret;
}
return op_target.obj_omap_set_val_by_key(dpp, key, val, must_exist);
}
+ int DBObject::chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y)
+ {
+ return 0;
+ }
+
std::unique_ptr<MPSerializer> DBObject::get_serializer(const DoutPrefixProvider *dpp,
const std::string& lock_name)
{
virtual int sync_user_stats(const DoutPrefixProvider *dpp, optional_yield y) override;
virtual int update_container_stats(const DoutPrefixProvider *dpp) override;
virtual int check_bucket_shards(const DoutPrefixProvider *dpp) override;
- virtual int chown(const DoutPrefixProvider *dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker = nullptr) override;
+ virtual int chown(const DoutPrefixProvider *dpp, User& new_user, optional_yield y) override;
virtual int put_info(const DoutPrefixProvider *dpp, bool exclusive, ceph::real_time mtime) override;
virtual bool is_owner(User* user) override;
virtual int check_empty(const DoutPrefixProvider *dpp, optional_yield y) override;
Attrs* vals) override;
virtual int omap_set_val_by_key(const DoutPrefixProvider *dpp, const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) override;
+ virtual int chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y) override;
private:
int read_attrs(const DoutPrefixProvider* dpp, DB::Object::Read &read_op, optional_yield y, rgw_obj* target_obj = nullptr);
};
return next->check_bucket_shards(dpp);
}
-int FilterBucket::chown(const DoutPrefixProvider* dpp, User* new_user,
- User* old_user, optional_yield y,
- const std::string* marker)
+int FilterBucket::chown(const DoutPrefixProvider* dpp, User& new_user, optional_yield y)
{
- return next->chown(dpp, new_user, old_user, y, marker);
+ return next->chown(dpp, new_user, y);
}
int FilterBucket::put_info(const DoutPrefixProvider* dpp, bool exclusive,
return next->omap_set_val_by_key(dpp, key, val, must_exist, y);
}
+int FilterObject::chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y)
+{
+ return next->chown(new_user, dpp, y);
+}
+
int FilterObject::FilterReadOp::prepare(optional_yield y, const DoutPrefixProvider* dpp)
{
/* Copy params into next */
virtual int sync_user_stats(const DoutPrefixProvider *dpp, optional_yield y) override;
virtual int update_container_stats(const DoutPrefixProvider* dpp) override;
virtual int check_bucket_shards(const DoutPrefixProvider* dpp) override;
- virtual int chown(const DoutPrefixProvider* dpp, User* new_user,
- User* old_user, optional_yield y,
- const std::string* marker = nullptr) override;
+ virtual int chown(const DoutPrefixProvider* dpp, User& new_user,
+ optional_yield y) override;
virtual int put_info(const DoutPrefixProvider* dpp, bool exclusive,
ceph::real_time mtime) override;
virtual bool is_owner(User* user) override;
virtual int omap_set_val_by_key(const DoutPrefixProvider *dpp,
const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) override;
+ virtual int chown(User& new_user, const DoutPrefixProvider* dpp,
+ optional_yield y) override;
virtual std::unique_ptr<Object> clone() override {
return std::make_unique<FilterObject>(*this);
return 0;
}
-int MotrBucket::chown(const DoutPrefixProvider *dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker)
+int MotrBucket::chown(const DoutPrefixProvider *dpp, User& new_user, optional_yield y)
{
// TODO: update bucket with new owner
-
- /* XXX: Update policies of all the bucket->objects with new user */
return 0;
}
return 0;
}
+int MotrObject::chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y)
+{
+ return 0;
+}
+
std::unique_ptr<MPSerializer> MotrObject::get_serializer(const DoutPrefixProvider *dpp,
const std::string& lock_name)
{
virtual int sync_user_stats(const DoutPrefixProvider *dpp, optional_yield y) override;
virtual int update_container_stats(const DoutPrefixProvider *dpp) override;
virtual int check_bucket_shards(const DoutPrefixProvider *dpp) override;
- virtual int chown(const DoutPrefixProvider *dpp, User* new_user, User* old_user, optional_yield y, const std::string* marker = nullptr) override;
+ virtual int chown(const DoutPrefixProvider *dpp, User& new_user, optional_yield y) override;
virtual int put_info(const DoutPrefixProvider *dpp, bool exclusive, ceph::real_time mtime) override;
virtual bool is_owner(User* user) override;
virtual int check_empty(const DoutPrefixProvider *dpp, optional_yield y) override;
Attrs* vals) override;
virtual int omap_set_val_by_key(const DoutPrefixProvider *dpp, const std::string& key, bufferlist& val,
bool must_exist, optional_yield y) override;
+ virtual int chown(User& new_user, const DoutPrefixProvider* dpp, optional_yield y) override;
private:
//int read_attrs(const DoutPrefixProvider* dpp, Motr::Object::Read &read_op, optional_yield y, rgw_obj* target_obj = nullptr);