From 84983387a220a29540aca64af774bbe7bc6b5ee6 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 29 Nov 2012 12:47:59 -0800 Subject: 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 --- src/rgw/rgw_op.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src') 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() -- cgit v1.2.1