diff --git a/go.mod b/go.mod index f3438371..73421137 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/magiconair/properties v1.8.1 // indirect github.com/mattn/go-sqlite3 v1.11.0 github.com/pelletier/go-toml v1.4.0 // indirect - github.com/pkg/sftp v1.10.1 + github.com/pkg/sftp v1.10.2-0.20190913011139-8fc59612f2b0 github.com/rs/xid v1.2.1 github.com/rs/zerolog v1.15.0 github.com/spf13/afero v1.2.2 // indirect diff --git a/go.sum b/go.sum index 25a22fbf..14585384 100644 --- a/go.sum +++ b/go.sum @@ -82,6 +82,8 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1 h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.10.2-0.20190913011139-8fc59612f2b0 h1:uSPJdIuCJRCOQWSER5+E2xC2KwmgKR4XFGiOSlJdsqA= +github.com/pkg/sftp v1.10.2-0.20190913011139-8fc59612f2b0/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= diff --git a/sftpd/sftpd_test.go b/sftpd/sftpd_test.go index 832b2612..e8ec7db1 100644 --- a/sftpd/sftpd_test.go +++ b/sftpd/sftpd_test.go @@ -325,7 +325,7 @@ func TestDirCommands(t *testing.T) { os.RemoveAll(user.GetHomeDir()) } -func TestSymlink(t *testing.T) { +func TestLink(t *testing.T) { usePubKey := false user, _, err := api.AddUser(getTestUser(usePubKey), http.StatusOK) if err != nil { @@ -359,6 +359,10 @@ func TestSymlink(t *testing.T) { if err == nil { t.Errorf("creating a symlink to an existing one must fail") } + err = client.Link(testFileName, testFileName+".hlink") + if err == nil { + t.Errorf("hard link is not supported and must fail") + } err = client.Remove(testFileName + ".link") if err != nil { t.Errorf("error removing symlink: %v", err)