sftpd: fix file upload resume detection

WinSCP does not set the APPEND flag while resuming a file upload,
so we detect a file upload resume if the TRUNCATE flag is not set.
The APPEND flag is now ignored.

Fixes #420
This commit is contained in:
Nicola Murino
2021-05-15 08:39:01 +02:00
parent f2b93c0402
commit f59f62317e
4 changed files with 44 additions and 30 deletions

View File

@@ -1191,7 +1191,7 @@ func TestQuotaLimits(t *testing.T) {
testFilePath2 := filepath.Join(homeBasePath, testFileName2)
err = createTestFile(testFilePath2, testFileSize2)
assert.NoError(t, err)
client := getWebDavClient(user, false, nil)
client := getWebDavClient(user, true, nil)
// test quota files
err = uploadFile(testFilePath, testFileName+".quota", testFileSize, client)
if !assert.NoError(t, err, "username: %v", user.Username) {