]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/acl: always fill in DisplayName for account owners/grants
authorCasey Bodley <cbodley@redhat.com>
Wed, 21 Feb 2024 19:04:43 +0000 (14:04 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 10 Apr 2024 17:09:16 +0000 (13:09 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_acl_s3.cc
src/rgw/rgw_auth.cc

index 37d7142c001cce80b45af58460817f0bfda45fa3..133a7afd2c95dda580af9911676ed8055b39ed8f 100644 (file)
@@ -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);
 }
 
index dc662c7b905dfb456122a231d0113429ec873438..f8673a771c86bba52fc4b3e8d0b18496b80adf74 100644 (file)
@@ -134,8 +134,8 @@ transform_old_authinfo(CephContext* const cct,
         owner.id.emplace<rgw_account_id>(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;
 }