From 9d628346ebf324d5557ffd83fe92210c59b750e3 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Fri, 30 Jun 2023 08:02:12 -0700 Subject: [PATCH] fix: service account list for root user (#17547) Fixes https://github.com/minio/minio/issues/17545 --- cmd/iam-store.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/iam-store.go b/cmd/iam-store.go index 7083c5303..497a324cd 100644 --- a/cmd/iam-store.go +++ b/cmd/iam-store.go @@ -2177,7 +2177,9 @@ func (store *IAMStoreSys) ListServiceAccounts(ctx context.Context, accessKey str } } - if !userExists { + // If root user has no STS/Service Accounts, userExists would be false here, + // so we handle this exception. + if !userExists && globalActiveCred.AccessKey != accessKey { return nil, errNoSuchUser }