]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: check appropriate entity permission on put_metadata 1858/head
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 23 May 2014 01:27:58 +0000 (18:27 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 23 May 2014 16:40:17 +0000 (09:40 -0700)
Fixes: #8428
Backport: firefly

Cannot use verify_object_permission() to test acls, as the operation
here might either be on object or on bucket.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_op.cc

index 4b2e6b7e04ccc97f1b0d649f5abab6cb5fe5fcad..c150d5b409cc1f9986232045ea3de433a12803d0 100644 (file)
@@ -1889,8 +1889,13 @@ done:
 
 int RGWPutMetadata::verify_permission()
 {
-  if (!verify_object_permission(s, RGW_PERM_WRITE))
-    return -EACCES;
+  if (s->object) {
+    if (!verify_object_permission(s, RGW_PERM_WRITE))
+      return -EACCES;
+  } else {
+    if (!verify_bucket_permission(s, RGW_PERM_WRITE))
+      return -EACCES;
+  }
 
   return 0;
 }