Allow file save from Office and possibly other apps. Enforces RFC4918 section 7.6 Write Locks and COPY/MOVE lock release on move.
Some checks failed
continuous-integration/drone/push Build was killed
Some checks failed
continuous-integration/drone/push Build was killed
This commit is contained in:
28
patches/002-dav-move-unlock.patch
Normal file
28
patches/002-dav-move-unlock.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
--- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/move.go
|
||||
+++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/move.go
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path"
|
||||
+ "time"
|
||||
|
||||
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
@@ -330,6 +331,16 @@ func (s *svc) handleMove(ctx context.Context, w http.ResponseWriter, r *http.Req
|
||||
return
|
||||
}
|
||||
|
||||
+ // Discard the held lock if present
|
||||
+ // Note: Specifically required by RFC4918 7.6 Write Locks and COPY/MOVE
|
||||
+ if len(mReq.LockId) != 0 {
|
||||
+ if err := s.LockSystem.Unlock(ctx, time.Now(), dst, mReq.LockId); err != nil {
|
||||
+ log.Error().Err(err).Msg("failed to release lock after MOVE")
|
||||
+ w.WriteHeader(http.StatusInternalServerError)
|
||||
+ return
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
dstStatRes, err = client.Stat(ctx, dstStatReq)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error sending grpc stat request")
|
||||
|
||||
Reference in New Issue
Block a user