rgw: return appropriate error for unresolvable email in acl

This commit is contained in:
Yehuda Sadeh 2011-04-18 12:54:02 -07:00
parent b8e791bc61
commit 878f4a45ce
3 changed files with 4 additions and 2 deletions

View 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;

View 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;
}

View 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" },