Skip to content

Commit

Permalink
fix: open with RDWR for exclusive file lock
Browse files Browse the repository at this point in the history
In order to place an exclusive lock on NFS storage, the file must be
opened for writing.

Fixes #3779

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
  • Loading branch information
dnwe authored and russjones committed May 29, 2020
1 parent 36bd590 commit c4ed842
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/events/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (u *Uploader) emitEvent(e UploadEvent) {
}

func (u *Uploader) uploadFile(lockFilePath string, sessionID session.ID) error {
lockFile, err := os.Open(lockFilePath)
lockFile, err := os.OpenFile(lockFilePath, os.O_RDWR, 0)
if err != nil {
return trace.ConvertSystemError(err)
}
Expand Down

0 comments on commit c4ed842

Please # to comment.