From d1bfb4d2c0611488a386adb827298790a9bf937b Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Tue, 23 Nov 2021 17:57:29 +0100 Subject: [PATCH] policy: Fix a typo when validating the list of policies (#13735) When assigning two policies to a user using mc command, the server code wrongly validates due to a typo in the code, the commit fixes it. --- cmd/iam-store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/iam-store.go b/cmd/iam-store.go index ccc1b9118..1a7f18bd6 100644 --- a/cmd/iam-store.go +++ b/cmd/iam-store.go @@ -805,7 +805,7 @@ func (store *IAMStoreSys) PolicyDBSet(ctx context.Context, name, policy string, // Handle policy mapping set/update mp := newMappedPolicy(policy) for _, p := range mp.toSlice() { - if _, found := cache.iamPolicyDocsMap[policy]; !found { + if _, found := cache.iamPolicyDocsMap[p]; !found { logger.LogIf(GlobalContext, fmt.Errorf("%w: (%s)", errNoSuchPolicy, p)) return errNoSuchPolicy }