Closed
Labels
Description
try to create a file called ..
curl -XPOST https://localhost:9200/remote.php/dav/files/Einstein/ -ueinstein:relativity -k -v -H'Tus-Resumable: 1.0.0' -H'Upload-Length: 10' -H'Upload-Metadata: filename Li4='
OCIS logs:
2020-12-02T15:34:18+05:45 INF access-log from=127.0.0.1:54328 method=POST path=/remote.php/dav/files/Einstein/ service=proxy
goroutine 307 [running]:
runtime/debug.Stack(0x0, 0x28af0c34f9b2a2b5, 0xfd78626c609640a4)
/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
runtime/debug.PrintStack()
/usr/local/go/src/runtime/debug/stack.go:16 +0x22
github.com/cs3org/reva/internal/grpc/interceptors/recovery.recoveryFunc(0x400aee0, 0xc000f5a6f0, 0x3452640, 0xc00034cad0, 0x0, 0x0)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/recovery/recovery.go:48 +0x26
github.com/grpc-ecosystem/go-grpc-middleware/recovery.recoverFrom(0x400aee0, 0xc000f5a6f0, 0x3452640, 0xc00034cad0, 0x3b4ae98, 0xc0003b0c20, 0x14a42c6)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/recovery/interceptors.go:61 +0x5a
github.com/grpc-ecosystem/go-grpc-middleware/recovery.UnaryServerInterceptor.func1.1(0xc0003b13df, 0x400aee0, 0xc000f5a6f0, 0xc0002b1540, 0xc0003b1488)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/recovery/interceptors.go:29 +0x6d
panic(0x3452640, 0xc00034cad0)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/cs3org/reva/internal/grpc/services/gateway.(*svc).split(0xc00132a000, 0x400aee0, 0xc000f5aa50, 0x56845ef, 0x1, 0x2, 0x0)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/services/gateway/storageprovider.go:2019 +0x513
github.com/cs3org/reva/internal/grpc/services/gateway.(*svc).isSharedFolder(...)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/services/gateway/storageprovider.go:1994
github.com/cs3org/reva/internal/grpc/services/gateway.(*svc).Stat(0xc00132a000, 0x400aee0, 0xc000f5aa50, 0xc0000f4230, 0xc00132a000, 0x341f200, 0x3f51710)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/services/gateway/storageprovider.go:1344 +0x657
github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1._GatewayAPI_Stat_Handler.func1(0x400aee0, 0xc000f5aa50, 0x38c7500, 0xc0000f4230, 0x39888a0, 0xc0003c4100, 0x400aee0, 0xc000f5aa50)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/cs3/gateway/v1beta1/gateway_api.pb.go:2638 +0x89
github.com/cs3org/reva/internal/grpc/interceptors/auth.NewUnary.func1(0x400aee0, 0xc000f5a6f0, 0x38c7500, 0xc0000f4230, 0xc000f5c3a0, 0xc000f5c3c0, 0x0, 0x0, 0x0, 0x0)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/auth/auth.go:96 +0x32b
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x400aee0, 0xc000f5a6f0, 0x38c7500, 0xc0000f4230, 0x35a3540, 0x594e918, 0x0, 0x0)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63
github.com/grpc-ecosystem/go-grpc-middleware/recovery.UnaryServerInterceptor.func1(0x400aee0, 0xc000f5a6f0, 0x38c7500, 0xc0000f4230, 0xc000f5c3a0, 0xc000f5c3e0, 0x0, 0x0, 0x0, 0x0)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/recovery/interceptors.go:33 +0xf7
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x400aee0, 0xc000f5a6f0, 0x38c7500, 0xc0000f4230, 0xc00040e700, 0x7f2139baa460, 0x0, 0xc000f5c4c0)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63
github.com/cs3org/reva/internal/grpc/interceptors/log.NewUnary.func1(0x400aee0, 0xc000f5a6f0, 0x38c7500, 0xc0000f4230, 0xc000f5c3a0, 0xc000f5c400, 0x0, 0xc000f5c4a0, 0x1, 0x1)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/log/log.go:39 +0x9e
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x400aee0, 0xc000f5a6f0, 0x38c7500, 0xc0000f4230, 0x2, 0x400aee0, 0xc000f5a6f0, 0xc000f5a6c0)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63
github.com/cs3org/reva/internal/grpc/interceptors/token.NewUnary.func1(0x400aee0, 0xc000f5a690, 0x38c7500, 0xc0000f4230, 0xc000f5c3a0, 0xc000f5c420, 0x39f6e80, 0xc000fc6480, 0x400aee0, 0xc000f5a690)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/token/token.go:44 +0xb4
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x400aee0, 0xc000f5a690, 0x38c7500, 0xc0000f4230, 0xc000f5a690, 0xc0004a0000, 0x4f, 0x1f4)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63
github.com/cs3org/reva/internal/grpc/interceptors/appctx.NewUnary.func1(0x400aee0, 0xc000f5a630, 0x38c7500, 0xc0000f4230, 0xc000f5c3a0, 0xc000f5c440, 0x294975a, 0x37b6d00, 0xc000f5c460, 0xc000f5c3a0)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/appctx/appctx.go:36 +0x4fc
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x400aee0, 0xc000f5a630, 0x38c7500, 0xc0000f4230, 0xc000494000, 0xc000f5c360, 0xc000275ac0, 0x14525a8)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1(0x400aee0, 0xc000f5a630, 0x38c7500, 0xc0000f4230, 0xc000f5c3a0, 0xc000f5c3c0, 0xc001513b30, 0x14ee438, 0x3840140, 0xc000f5a630)
/home/artur/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:34 +0xd5
github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1._GatewayAPI_Stat_Handler(0x3a753c0, 0xc00132a000, 0x400aee0, 0xc000f5a630, 0xc000fc63c0, 0xc0004185d0, 0x400aee0, 0xc000f5a630, 0xc000a247c8, 0x5)
/home/artur/go/pkg/mod/github.com/cs3org/[email protected]/cs3/gateway/v1beta1/gateway_api.pb.go:2640 +0x14b
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00116e600, 0x402d980, 0xc000543500, 0xc000494000, 0xc000418810, 0x564ee08, 0x0, 0x0, 0x0)
/home/artur/go/pkg/mod/google.golang.org/[email protected]/server.go:1024 +0x4f4
google.golang.org/grpc.(*Server).handleStream(0xc00116e600, 0x402d980, 0xc000543500, 0xc000494000, 0x0)
/home/artur/go/pkg/mod/google.golang.org/[email protected]/server.go:1313 +0xd99
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000294980, 0xc00116e600, 0x402d980, 0xc000543500, 0xc000494000)
/home/artur/go/pkg/mod/google.golang.org/[email protected]/server.go:722 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1
/home/artur/go/pkg/mod/google.golang.org/[email protected]/server.go:720 +0xa1
2020-12-02T15:34:18+05:45 ERR split: len(parts) < 2: path:/ parts:[] pkg=rgrpc service=storage traceid=b5a2b2f9340caf28a44096606c6278fd
2020-12-02T15:34:18+05:45 ERR unary code=Internal end="02/Dec/2020:15:34:18 +0545" from=tcp://127.0.0.1:47280 pkg=rgrpc service=storage start="02/Dec/2020:15:34:18 +0545" time_ns=313914 traceid=b5a2b2f9340caf28a44096606c6278fd uri=/cs3.gateway.v1beta1.GatewayAPI/Stat user-agent=grpc-go/1.26.0
2020-12-02T15:34:18+05:45 ERR error sending grpc stat request error="rpc error: code = Internal desc = split: len(parts) < 2: path:/ parts:[]" pkg=rhttp service=storage traceid=b5a2b2f9340caf28a44096606c6278fd
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]filename '..' causes an Error 500 when used in the TUS protocol[/-][+]Filename '..' causes an Error 500 when used in the TUS protocol[/+]kobergj commentedon Jun 3, 2024
There is no panic anymore (which is good). However server still reacts strangely.
When trying to create
..file inside a folder, ocis responds500 Internal Server Error, error log:When trying to create
..file on a space root ocis will respond405 Method Not Allowedwith no error log.Both is wrong. Ocis should return a
400 Bad Requestin both cases.dragonchaser commentedon Jun 10, 2024
ATM I get 3 different results:
403 Forbidden412 Percondition Failed201 CreatedThis looks somewhat fishy.....
Update:
InitiateFileUploadfunc inreva/internal/grpc/services/storageprovider/storageprovider.goI only get201 Created😱dragonchaser commentedon Jun 13, 2024
The approach to disallow uploading
..with the validators in reva makes things worse, fixes this issue, but breaks webdav... back to square 1...dragonchaser commentedon Jun 18, 2024
Blocked for now, need to clarify with @butonic
butonic commentedon Jun 24, 2024
TL;dr AFAICT we need to always call path.Clean() ... maybe we forgot that somewhere?
Long version summoning RFC 3986 3.3. Path:
dragonchaser commentedon Jun 25, 2024
@butonic thx, So I assume it would be sane to disallow ".." as standalone path as proposed in cs3org/reva#4721. This would just leave us with the non-deterministic behavior of the storage list.
butonic commentedon Jun 25, 2024
yes. that should result in a bad request error imo
dragonchaser commentedon Jun 25, 2024
It does randomly 😆
micbar commentedon Jul 8, 2024
Reva bump was merged.