From 4420929eacb67d17635fed53f15471a28942f31d Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 23 Sep 2015 09:49:36 -0500 Subject: [PATCH] rgw: fix modification to index attrs when setting acls Fixes: #12955 - add ACL change after initial population - populate bufferlist with object attributes Signed-off-by: Brian Felton (cherry picked from commit 7496741ebbd75b74d5ffeca5341cccb2318176e6) --- src/rgw/rgw_op.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 4301bdde8b4c..2ac298fedafa 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2562,8 +2562,17 @@ void RGWPutACLs::execute() new_policy.encode(bl); obj = rgw_obj(s->bucket, s->object); map attrs; - attrs[RGW_ATTR_ACL] = bl; + store->set_atomic(s->obj_ctx, obj); + + if (!s->object.empty()) { + ret = get_obj_attrs(store, s, obj, attrs); + if (ret < 0) + return; + } + + attrs[RGW_ATTR_ACL] = bl; + if (!s->object.empty()) { ret = store->set_attrs(s->obj_ctx, obj, attrs, NULL, ptracker); } else { -- 2.47.3