sftp actions: add a parameter to distinguish local and remote files

This commit is contained in:
Nicola Murino
2020-01-23 23:23:28 +01:00
parent 5f4efc9148
commit 6884ce3f3e
6 changed files with 16 additions and 12 deletions

View File

@@ -314,7 +314,7 @@ func (c Connection) handleSFTPRename(sourcePath string, targetPath string, reque
return vfs.GetSFTPError(c.fs, err)
}
logger.CommandLog(renameLogSender, sourcePath, targetPath, c.User.Username, "", c.ID, c.protocol, -1, -1, "", "", "")
go executeAction(operationRename, c.User.Username, sourcePath, targetPath, "", 0)
go executeAction(operationRename, c.User.Username, sourcePath, targetPath, "", 0, vfs.IsLocalOsFs(c.fs))
return nil
}
@@ -404,7 +404,7 @@ func (c Connection) handleSFTPRemove(filePath string, request *sftp.Request) err
if fi.Mode()&os.ModeSymlink != os.ModeSymlink {
dataprovider.UpdateUserQuota(dataProvider, c.User, -1, -size, false)
}
go executeAction(operationDelete, c.User.Username, filePath, "", "", fi.Size())
go executeAction(operationDelete, c.User.Username, filePath, "", "", fi.Size(), vfs.IsLocalOsFs(c.fs))
return sftp.ErrSSHFxOk
}