From: wangyunqing Date: Mon, 20 Apr 2020 09:15:44 +0000 (+0800) Subject: rgw: belong the anonymous object to the bucket owner X-Git-Tag: v16.1.0~420^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34462%2Fhead;p=ceph.git rgw: belong the anonymous object to the bucket owner Signed-off-by: wangyunqing --- diff --git a/src/rgw/rgw_acl_s3.h b/src/rgw/rgw_acl_s3.h index 7d6af264154c..eac141247403 100644 --- a/src/rgw/rgw_acl_s3.h +++ b/src/rgw/rgw_acl_s3.h @@ -89,8 +89,12 @@ public: virtual int create_canned(ACLOwner& _owner, ACLOwner& bucket_owner, const string& canned_acl) { RGWAccessControlList_S3& _acl = static_cast(acl); - int ret = _acl.create_canned(_owner, bucket_owner, canned_acl); - owner = _owner; + if (_owner.get_id() == rgw_user("anonymous")) { + owner = bucket_owner; + } else { + owner = _owner; + } + int ret = _acl.create_canned(owner, bucket_owner, canned_acl); return ret; } int create_from_headers(RGWUserCtl *user_ctl, const RGWEnv *env, ACLOwner& _owner);