From e1ae90c12b7ac6bb5e09dc11e64dbd8aa09f0dd9 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 30 Jan 2019 00:51:09 -0800 Subject: [PATCH] Make sure to pass the right username for correct ConditionValues (#7169) Without passing proper username value would result in AccessDenied errors when policies with `{aws:username}` substitutions are used. Fixes #7165 --- cmd/web-handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index 6dfb0a38f..a2927d300 100644 --- a/cmd/web-handlers.go +++ b/cmd/web-handlers.go @@ -471,7 +471,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r AccountName: claims.Subject, Action: iampolicy.ListBucketAction, BucketName: args.BucketName, - ConditionValues: getConditionValues(r, "", ""), + ConditionValues: getConditionValues(r, "", claims.Subject), IsOwner: owner, }) @@ -479,7 +479,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r AccountName: claims.Subject, Action: iampolicy.PutObjectAction, BucketName: args.BucketName, - ConditionValues: getConditionValues(r, "", ""), + ConditionValues: getConditionValues(r, "", claims.Subject), IsOwner: owner, ObjectName: args.Prefix + "/", })