]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return appropriate error for unresolvable email in acl
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 18 Apr 2011 19:54:02 +0000 (12:54 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 18 Apr 2011 19:54:31 +0000 (12:54 -0700)
src/rgw/rgw_common.h
src/rgw/rgw_op.cc
src/rgw/rgw_rest.cc

index 39edda3aaee518409e8fe404a57baad20b862001..6b386b769de283c7e97aeaf3a579a7add2bf45ae 100644 (file)
@@ -68,7 +68,8 @@ extern string rgw_root_bucket;
 #define ERR_NO_SUCH_BUCKET      2002
 #define ERR_METHOD_NOT_ALLOWED  2003
 #define ERR_INVALID_DIGEST      2004
-#define ERR_BAD_DIGEST         2005
+#define ERR_BAD_DIGEST          2005
+#define ERR_UNRESOLVABLE_EMAIL  2006
 
 typedef void *RGWAccessHandle;
 
index 94466a8005cdfbe79753ea81a52eccc24daddd76..07825ab0c8c80dc292069a6788f9f9c667c4f282 100644 (file)
@@ -632,7 +632,7 @@ static int rebuild_policy(RGWAccessControlPolicy& src, RGWAccessControlPolicy& d
         RGW_LOG(10) << "grant user email=" << email << endl;
         if (rgw_get_user_info_by_email(email, grant_user) < 0) {
           RGW_LOG(10) << "grant user email not found or other error" << endl;
-          break;
+          return -ERR_UNRESOLVABLE_EMAIL;
         }
         id = grant_user.user_id;
       }
index 126d189dc063ffb923780ddef8e8ff1e6591ec4a..b640b012caf809a4cdb1cc81eeb252ce85f2115a 100644 (file)
@@ -44,6 +44,7 @@ const static struct rgw_html_errors RGW_HTML_ERRORS[] = {
     { ERR_BAD_DIGEST, 500, "BadDigest" },
     { ERR_INVALID_BUCKET_NAME, 400, "InvalidBucketName" },
     { ERR_INVALID_OBJECT_NAME, 400, "InvalidObjectName" },
+    { ERR_UNRESOLVABLE_EMAIL, 400, "UnresolvableGrantByEmailAddress" },
     { EACCES, 403, "AccessDenied" },
     { EPERM, 403, "AccessDenied" },
     { ENOENT, 404, "NoSuchKey" },