s3: Stat() to filter object name when falling back to listing (#3449)

client S3 Stat() API tries to use HEAD requests but fall back to regular
listing when there is a permission issue with HEAD or when the object is
encrypted using SSE-C.

However the code accepts any entry from the minio-go listing API
which is wrong. It needs to only accept the object name as passed
by the the upper layer.
This commit is contained in:
Anis Elleuch
2020-10-10 15:24:39 -07:00
committed by GitHub
parent bb2bfdc918
commit 8a8611cf74
+4
View File
@@ -1433,6 +1433,10 @@ func (c *S3Client) Stat(ctx context.Context, opts StatOptions) (*ClientContent,
return nil, probe.NewError(objectStat.Err)
}
if objectStat.Key != object {
break
}
return c.objectInfo2ClientContent(bucket, objectStat), nil
}