From 3ac5af47f22776acb08c5980c63a7c7b5df7bb5e Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Fri, 15 Nov 2019 12:26:52 +0100 Subject: [PATCH] minor fixes --- dataprovider/user.go | 2 +- sftpd/sftpd_test.go | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dataprovider/user.go b/dataprovider/user.go index 87ce1b3b..c1825799 100644 --- a/dataprovider/user.go +++ b/dataprovider/user.go @@ -32,7 +32,7 @@ const ( PermCreateSymlinks = "create_symlinks" // changing file or directory permissions is allowed PermChmod = "chmod" - // changing file or directory owner is allowed + // changing file or directory owner and group is allowed PermChown = "chown" ) diff --git a/sftpd/sftpd_test.go b/sftpd/sftpd_test.go index 28711821..04b1eaf0 100644 --- a/sftpd/sftpd_test.go +++ b/sftpd/sftpd_test.go @@ -499,6 +499,9 @@ func TestLink(t *testing.T) { func TestStat(t *testing.T) { usePubKey := false user, _, err := httpd.AddUser(getTestUser(usePubKey), http.StatusOK) + if err != nil { + t.Errorf("unable to add user: %v", err) + } client, err := getSftpClient(user, usePubKey) if err != nil { t.Errorf("unable to create sftp client: %v", err) @@ -507,10 +510,7 @@ func TestStat(t *testing.T) { testFileName := "test_file.dat" testFilePath := filepath.Join(homeBasePath, testFileName) testFileSize := int64(65535) - err = createTestFile(testFilePath, testFileSize) - if err != nil { - t.Errorf("unable to create test file: %v", err) - } + createTestFile(testFilePath, testFileSize) err = sftpUploadFile(testFilePath, testFileName, testFileSize, client) if err != nil { t.Errorf("file upload error: %v", err) @@ -558,6 +558,9 @@ func TestStat(t *testing.T) { } } _, err = httpd.RemoveUser(user, http.StatusOK) + if err != nil { + t.Errorf("unable to remove user: %v", err) + } os.RemoveAll(user.GetHomeDir()) }