]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix setting acls on the bucket
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 30 Jul 2010 23:11:07 +0000 (16:11 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 30 Jul 2010 23:12:43 +0000 (16:12 -0700)
src/rgw/rgw_rados.cc

index 3de07359c50e31fe87121a25a7a7767d7741693b..e55610818206ca6b46755eab72a439494e05fdef 100644 (file)
@@ -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;