diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2012-11-29 12:47:59 -0800 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2012-11-29 13:50:02 -0800 |
commit | 84983387a220a29540aca64af774bbe7bc6b5ee6 (patch) | |
tree | 8e42a1453498c2410715e5cbd47ab8597114a1a1 | |
parent | 6c1e2b663227cadff4255db3321976882df6b261 (diff) | |
download | ceph-84983387a220a29540aca64af774bbe7bc6b5ee6.tar.gz |
rgw: fix PUT acls
This fixes a regression introduced at
17e4c0df44781f5ff1d74f3800722452b6a0fc58. The original
patch fixed error leak, however it also removed the
operation's send_response() call.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_op.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index e30b4dff976..40e496acc72 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1311,7 +1311,7 @@ void RGWPutACLs::execute() if (!parser.init()) { ret = -EINVAL; - return; + goto done; } owner.set_id(s->user.user_id); @@ -1319,18 +1319,18 @@ void RGWPutACLs::execute() ret = get_params(); if (ret < 0) - return; + goto done; ldout(s->cct, 15) << "read len=" << len << " data=" << (data ? data : "") << dendl; if (!s->canned_acl.empty() && len) { ret = -EINVAL; - return; + goto done; } if (!s->canned_acl.empty()) { ret = get_canned_policy(owner, ss); if (ret < 0) - return; + goto done; new_data = strdup(ss.str().c_str()); free(data); @@ -1341,12 +1341,12 @@ void RGWPutACLs::execute() if (!parser.parse(data, len, 1)) { ret = -EACCES; - return; + goto done; } policy = (RGWAccessControlPolicy_S3 *)parser.find_first("AccessControlPolicy"); if (!policy) { ret = -EINVAL; - return; + goto done; } if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { @@ -1357,7 +1357,7 @@ void RGWPutACLs::execute() ret = policy->rebuild(&owner, new_policy); if (ret < 0) - return; + goto done; if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { ldout(s->cct, 15) << "New AccessControlPolicy:"; @@ -1369,6 +1369,9 @@ void RGWPutACLs::execute() obj.init(s->bucket, s->object_str); rgwstore->set_atomic(s->obj_ctx, obj); ret = rgwstore->set_attr(s->obj_ctx, obj, RGW_ATTR_ACL, bl); + +done: + send_response(); } int RGWInitMultipart::verify_permission() |