From a0caa204042394a01e43351fc22f247fa8b66adc Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Sun, 17 Apr 2016 12:22:27 +0200 Subject: [PATCH] rgw: allow giving perms in Swift ACLs to an identity who don't have a local account. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_acl.h | 2 +- src/rgw/rgw_acl_swift.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_acl.h b/src/rgw/rgw_acl.h index 6ae2cbd0621ee..f10998beb8612 100644 --- a/src/rgw/rgw_acl.h +++ b/src/rgw/rgw_acl.h @@ -184,7 +184,7 @@ public: ACLGroupTypeEnum uri_to_group(string& uri); - void set_canon(const rgw_user& _id, string& _name, int perm) { + void set_canon(const rgw_user& _id, const string& _name, const int perm) { type.set(ACL_TYPE_CANON_USER); id = _id; name = _name; diff --git a/src/rgw/rgw_acl_swift.cc b/src/rgw/rgw_acl_swift.cc index 731c98585dd12..228866ce08387 100644 --- a/src/rgw/rgw_acl_swift.cc +++ b/src/rgw/rgw_acl_swift.cc @@ -138,6 +138,8 @@ void RGWAccessControlPolicy_SWIFT::add_grants(RGWRados * const store, if (rgw_get_user_info_by_uid(store, user, grant_user) < 0) { ldout(cct, 10) << "grant user does not exist: " << uid << dendl; /* skipping silently */ + grant.set_canon(user, std::string(), perm); + acl.add_grant(&grant); } else { grant.set_canon(user, grant_user.display_name, perm); acl.add_grant(&grant); @@ -224,6 +226,8 @@ void RGWAccessControlPolicy_SWIFTAcct::add_grants(RGWRados * const store, if (rgw_get_user_info_by_uid(store, user, grant_user) < 0) { ldout(cct, 10) << "grant user does not exist:" << uid << dendl; /* skipping silently */ + grant.set_canon(user, std::string(), perm); + acl.add_grant(&grant); } else { grant.set_canon(user, grant_user.display_name, perm); acl.add_grant(&grant); -- 2.39.5