mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
reject object lock requests on existing buckets (#9684)
a regression was introduced fix it to ensure that we do not allow object locking settings on existing buckets without object locking
This commit is contained in:
parent
7dbfea1353
commit
c138272d63
@ -1032,6 +1032,12 @@ func (api objectAPIHandlers) PutBucketObjectLockConfigHandler(w http.ResponseWri
|
||||
return
|
||||
}
|
||||
|
||||
// Deny object locking configuration settings on existing buckets without object lock enabled.
|
||||
if _, err = globalBucketMetadataSys.GetObjectLockConfig(bucket); err != nil {
|
||||
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
|
||||
return
|
||||
}
|
||||
|
||||
if err = globalBucketMetadataSys.Update(bucket, objectLockConfig, configData); err != nil {
|
||||
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user