Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/webdav: cannot handle symbolic link that points to a non existed file #55339

Open
jjm2473 opened this issue Sep 22, 2022 · 1 comment
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jjm2473
Copy link

jjm2473 commented Sep 22, 2022

What version of Go are you using (go version)?

$ go version
go1.18

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jjm/Library/Caches/go-build"
GOENV="/Users/jjm/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/jjm/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jjm/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Volumes/data/src/gowebdav/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7b/lr1hrhyd3ts3v_d8m7bjngdh0000gn/T/go-build747360344=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I have build a webdav server and run it on a router, serve router's /mnt as webdav root, then mount it on macOS. When I create a symbol link in /mnt ln -s /tmp/noexist /mnt/noexist (/tmp/noexist does not existed),then PROPFIND / with Depth=1 will get a Internal Server Error (Wireshark capture below).

===== Request =====
PROPFIND / HTTP/1.1
Host: 192.168.31.1:6086
Content-Type: text/xml
Depth: 1
Accept: */*
User-Agent: WebDAVFS/3.0.0 (03008000) Darwin/21.6.0 (x86_64)
Authorization: Basic ***
Content-Length: 179
Connection: keep-alive

<?xml version="1.0" encoding="utf-8"?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:getlastmodified/>
<D:getcontentlength/>
<D:creationdate/>
<D:resourcetype/>
</D:prop>
</D:propfind>

===== Response =====
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset=utf-8
Date: Thu, 22 Sep 2022 06:12:53 GMT
Content-Length: 516

<?xml version="1.0" encoding="UTF-8"?><D:multistatus xmlns:D="DAV:"><D:response><D:href>/</D:href><D:propstat><D:prop><D:getlastmodified>Thu, 22 Sep 2022 06:12:32 GMT</D:getlastmodified><D:resourcetype><D:collection xmlns:D="DAV:"/></D:resourcetype></D:prop><D:status>HTTP/1.1 200 OK</D:status></D:propstat><D:propstat><D:prop><D:getcontentlength></D:getcontentlength><D:creationdate></D:creationdate></D:prop><D:status>HTTP/1.1 404 Not Found</D:status></D:propstat></D:response></D:multistatus>Internal Server Error

What did you expect to see?

List root dir

What did you see instead?

Internal Server Error

@gopherbot gopherbot added this to the Unreleased milestone Sep 22, 2022
@jjm2473 jjm2473 changed the title x/net: webdav can not handle symbol link that point to non existed file. x/net: webdav can not handle symbol link that points to a non existed file. Sep 22, 2022
@cherrymui cherrymui changed the title x/net: webdav can not handle symbol link that points to a non existed file. x/net/webdav: cannot handle symbolic link that points to a non existed file Sep 22, 2022
@cherrymui
Copy link
Member

cc @neild @ianlancetaylor

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants