fix: service account list for root user (#17547)

Fixes https://github.com/minio/minio/issues/17545
This commit is contained in:
Aditya Manthramurthy 2023-06-30 08:02:12 -07:00 committed by GitHub
parent bde533a9c7
commit 9d628346eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}