]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: belong the anonymous object to the bucket owner 34462/head
authorwangyunqing <wangyunqing@inspur.com>
Mon, 20 Apr 2020 09:15:44 +0000 (17:15 +0800)
committerwangyunqing <wangyunqing@inspur.com>
Mon, 20 Apr 2020 09:15:44 +0000 (17:15 +0800)
Signed-off-by: wangyunqing <wangyunqing@inspur.com>
src/rgw/rgw_acl_s3.h

index 7d6af264154c579d7ff5c58ac212e164bef35d97..eac1412474039767d2cee348c270721af744cde0 100644 (file)
@@ -89,8 +89,12 @@ public:
 
   virtual int create_canned(ACLOwner& _owner, ACLOwner& bucket_owner, const string& canned_acl) {
     RGWAccessControlList_S3& _acl = static_cast<RGWAccessControlList_S3 &>(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);