mirror of
https://github.com/minio/minio.git
synced 2025-01-13 07:53:21 -05:00
Make sure we use O_EXCL with O_CREATE to make sure we don't trip over existing file
This commit is contained in:
parent
b2ee7d989d
commit
3929135c34
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func newDonutFileWriter(objectDir string) (Writer, error) {
|
||||
dataFile, err := os.OpenFile(path.Join(objectDir, "data"), os.O_WRONLY|os.O_CREATE, 0600)
|
||||
dataFile, err := os.OpenFile(path.Join(objectDir, "data"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC|os.O_EXCL, 0600)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user