From: Casey Bodley Date: Wed, 21 Feb 2024 19:04:43 +0000 (-0500) Subject: rgw/acl: always fill in DisplayName for account owners/grants X-Git-Tag: v19.1.0~99^2~52 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c844e4dc29cf75d2ab129f2162758aeefc98eab9;p=ceph.git rgw/acl: always fill in DisplayName for account owners/grants Signed-off-by: Casey Bodley (cherry picked from commit 1a1f3a0b94e575981cb568c4f8db2f383ab5314f) --- diff --git a/src/rgw/rgw_acl_s3.cc b/src/rgw/rgw_acl_s3.cc index 37d7142c001c..133a7afd2c95 100644 --- a/src/rgw/rgw_acl_s3.cc +++ b/src/rgw/rgw_acl_s3.cc @@ -315,8 +315,11 @@ static int read_owner_display_name(const DoutPrefixProvider* dpp, RGWAccountInfo info; rgw::sal::Attrs attrs; RGWObjVersionTracker objv; - // don't use account names in acls. just verify that the account exists - return driver->load_account_by_id(dpp, y, account_id, info, attrs, objv); + int r = driver->load_account_by_id(dpp, y, account_id, info, attrs, objv); + if (r >= 0) { + name = info.name; + } + return r; }), owner); } diff --git a/src/rgw/rgw_auth.cc b/src/rgw/rgw_auth.cc index dc662c7b905d..f8673a771c86 100644 --- a/src/rgw/rgw_auth.cc +++ b/src/rgw/rgw_auth.cc @@ -134,8 +134,8 @@ transform_old_authinfo(CephContext* const cct, owner.id.emplace(account_id); } else { owner.id = id; - owner.display_name = display_name; } + owner.display_name = display_name; return owner; } @@ -847,8 +847,8 @@ ACLOwner rgw::auth::LocalApplier::get_aclowner() const owner.id = user_info.account_id; } else { owner.id = user_info.user_id; - owner.display_name = user_info.display_name; } + owner.display_name = user_info.display_name; return owner; }