fix: svc accounts cannot have same name as parent/targetUser (#13082)

Currently in master this can cause existing
parent users to stop working and lead to
credentials getting overwritten.

```
~ mc admin user add alias/ minio123 minio123456
```

```
~ mc admin user svcacct add alias/ minio123 \
    --access-key minio123 --secret-key minio123456
```

This PR rejects all such scenarios.
This commit is contained in:
Harshavardhana
2021-08-26 21:57:30 -07:00
committed by GitHub
parent ed16ce9b73
commit ae8f7f11d5
2 changed files with 31 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ var errGroupNotEmpty = errors.New("Specified group is not empty - cannot remove
var errNoSuchPolicy = errors.New("Specified canned policy does not exist")
// error returned in IAM subsystem when an external users systems is configured.
var errIAMActionNotAllowed = errors.New("Specified IAM action is not allowed with LDAP configuration")
var errIAMActionNotAllowed = errors.New("Specified IAM action is not allowed")
// error returned in IAM subsystem when IAM sub-system is still being initialized.
var errIAMNotInitialized = errors.New("IAM sub-system is being initialized, please try again")