Skip to content

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

@jjm2473

Description

@jjm2473

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions