]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return -EACCESS for system requests also 8259/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Tue, 22 Mar 2016 14:27:49 +0000 (15:27 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Tue, 22 Mar 2016 14:27:49 +0000 (15:27 +0100)
In a multisite scenario, if a user created in a secondary zone tries to
create a bucket, fail with AccessDenied instead of a NoSuchKey, which
doesn't make sense for a create Bucket request for eg.

Fixes: #15234
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_rest_s3.cc

index 9c525d15adea9d6dec6ca94f676a83c785081a64..a0365bdbbb26d499fffc31b4342f37f8b19a4f51 100644 (file)
@@ -3600,7 +3600,7 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s)
       int ret = rgw_get_user_info_by_uid(store, effective_uid, effective_user);
       if (ret < 0) {
         ldout(s->cct, 0) << "User lookup failed!" << dendl;
-        return -ENOENT;
+        return -EACCES;
       }
       *(s->user) = effective_user;
     }
@@ -3808,7 +3808,7 @@ int RGW_Auth_S3::authorize_v2(RGWRados *store, struct req_state *s)
         ret = rgw_get_user_info_by_uid(store, euid, effective_user);
         if (ret < 0) {
           ldout(s->cct, 0) << "User lookup failed!" << dendl;
-          return -ENOENT;
+          return -EACCES;
         }
         *(s->user) = effective_user;
       }