From: Yehuda Sadeh Date: Fri, 30 Jul 2010 23:11:07 +0000 (-0700) Subject: rgw: fix setting acls on the bucket X-Git-Tag: v0.22~358 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7153244734a61360aee3f066447b7529e730992a;p=ceph.git rgw: fix setting acls on the bucket --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3de07359c50..e5561081820 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -471,12 +471,19 @@ int RGWRados::set_attr(std::string& bucket, std::string& oid, const char *name, bufferlist& bl) { rados_pool_t pool; + string actual_bucket = bucket; + string actual_obj = oid; - int r = open_pool(bucket, &pool); + if (actual_obj.size() == 0) { + actual_obj = bucket; + actual_bucket = root_bucket; + } + + int r = open_pool(actual_bucket, &pool); if (r < 0) return r; - r = rados->setxattr(pool, oid, name, bl); + r = rados->setxattr(pool, actual_obj, name, bl); if (r < 0) return r;