mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 04:30:26 +03:00
Fix bug preventing overwrite of object if (#8796)
object lock config is enabled for a bucket. Creating a bucket with object lock configuration enabled does not automatically cause WORM protection to be applied. PUT operation needs to specifically request object locking or bucket has to have default retention settings configured. Fixes regression introduced in #8657
This commit is contained in:
+2
-3
@@ -477,8 +477,7 @@ func enforceRetentionBypassForPut(ctx context.Context, r *http.Request, bucket,
|
||||
ret := getObjectRetentionMeta(oi.UserDefined)
|
||||
// no retention metadata on object
|
||||
if ret.Mode == Invalid {
|
||||
_, isWORMBucket := isWORMEnabled(bucket)
|
||||
if !isWORMBucket {
|
||||
if _, isWORMBucket := globalBucketObjectLockConfig.Get(bucket); !isWORMBucket {
|
||||
return oi, ErrInvalidBucketObjectLockConfiguration
|
||||
}
|
||||
return oi, ErrNone
|
||||
@@ -527,7 +526,7 @@ func checkPutObjectRetentionAllowed(ctx context.Context, r *http.Request, bucket
|
||||
var mode RetentionMode
|
||||
var retainDate RetentionDate
|
||||
|
||||
retention, isWORMBucket := isWORMEnabled(bucket)
|
||||
retention, isWORMBucket := globalBucketObjectLockConfig.Get(bucket)
|
||||
|
||||
retentionRequested := isObjectLockRequested(r.Header)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user