mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
fix connection limits
an SFTP client can start multiple transfers on a single connection Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -246,11 +246,15 @@ func (c *sshCommand) handleHashCommands() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *sshCommand) executeSystemCommand(command systemCommand) error {
|
||||
func (c *sshCommand) executeSystemCommand(command systemCommand) error { //nolint:gocyclo
|
||||
sshDestPath := c.getDestPath()
|
||||
if !c.isLocalPath(sshDestPath) {
|
||||
return c.sendErrorResponse(errUnsupportedConfig)
|
||||
}
|
||||
if err := common.Connections.IsNewTransferAllowed(c.connection.User.Username); err != nil {
|
||||
err := fmt.Errorf("denying command due to transfer count limits")
|
||||
return c.sendErrorResponse(err)
|
||||
}
|
||||
diskQuota, transferQuota := c.connection.HasSpace(true, false, command.quotaCheckPath)
|
||||
if !diskQuota.HasSpace || !transferQuota.HasUploadSpace() || !transferQuota.HasDownloadSpace() {
|
||||
return c.sendErrorResponse(common.ErrQuotaExceeded)
|
||||
|
||||
Reference in New Issue
Block a user