From: wangyunqing Date: Mon, 23 Nov 2020 03:19:55 +0000 (+0800) Subject: rgw : check the object size when copy obj X-Git-Tag: v17.1.0~84^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7e961d3ebd6cc39b38691bf6b4b7074db175c37b;p=ceph.git rgw : check the object size when copy obj Fixes: https://tracker.ceph.com/issues/48322 Signed-off-by: wangyunqing --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 64f4fc0e6403..def5c1dba1ff 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -5414,6 +5414,10 @@ void RGWCopyObj::execute(optional_yield y) obj_size = astate->size; if (!s->system_request) { // no quota enforcement for system requests + if (astate->accounted_size > static_cast(s->cct->_conf->rgw_max_put_size)) { + op_ret = -ERR_TOO_LARGE; + return; + } // enforce quota against the destination bucket owner op_ret = dest_bucket->check_quota(this, user_quota, bucket_quota, astate->accounted_size, y);