From ff8fb80e3cec5393bae1fc3a7ecb117a25880a82 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Fri, 26 Jul 2019 13:07:08 +0200 Subject: [PATCH] fix check for used quota remove unused data provider from sftpd configuration struct --- sftpd/handler.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sftpd/handler.go b/sftpd/handler.go index 5fc40cd5..7f7ff8ff 100644 --- a/sftpd/handler.go +++ b/sftpd/handler.go @@ -30,7 +30,6 @@ type Connection struct { lastActivity time.Time lock *sync.Mutex sshConn *ssh.ServerConn - dataProvider dataprovider.Provider } // Fileread creates a reader for a file on the system and returns the reader back. @@ -401,7 +400,7 @@ func (c Connection) handleSFTPRemove(path string) error { func (c Connection) hasSpace(checkFiles bool) bool { if (checkFiles && c.User.QuotaFiles > 0) || c.User.QuotaSize > 0 { - numFile, size, err := dataprovider.GetUsedQuota(c.dataProvider, c.User.Username) + numFile, size, err := dataprovider.GetUsedQuota(dataProvider, c.User.Username) if err != nil { if _, ok := err.(*dataprovider.MethodDisabledError); ok { logger.Warn(logSender, "quota enforcement not possible for user %v: %v", c.User.Username, err)