mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
event action: add update modtime to fs rename
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -457,7 +457,7 @@ func (c *Connection) handleSFTPUploadToExistingFile(fs vfs.Fs, pflags sftp.FileO
|
||||
}
|
||||
|
||||
if common.Config.IsAtomicUploadEnabled() && fs.IsAtomicUploadSupported() {
|
||||
_, _, err = fs.Rename(resolvedPath, filePath)
|
||||
_, _, err = fs.Rename(resolvedPath, filePath, 0)
|
||||
if err != nil {
|
||||
c.Log(logger.LevelError, "error renaming existing file for atomic upload, source: %q, dest: %q, err: %+v",
|
||||
resolvedPath, filePath, err)
|
||||
|
||||
@@ -146,7 +146,7 @@ func (fs MockOsFs) Remove(name string, _ bool) error {
|
||||
}
|
||||
|
||||
// Rename renames (moves) source to target
|
||||
func (fs MockOsFs) Rename(source, target string) (int, int64, error) {
|
||||
func (fs MockOsFs) Rename(source, target string, _ int) (int, int64, error) {
|
||||
if fs.err != nil {
|
||||
return -1, -1, fs.err
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ func (c *scpCommand) handleUpload(uploadFilePath string, sizeToRead int64) error
|
||||
}
|
||||
|
||||
if common.Config.IsAtomicUploadEnabled() && fs.IsAtomicUploadSupported() {
|
||||
_, _, err = fs.Rename(p, filePath)
|
||||
_, _, err = fs.Rename(p, filePath, 0)
|
||||
if err != nil {
|
||||
c.connection.Log(logger.LevelError, "error renaming existing file for atomic upload, source: %q, dest: %q, err: %v",
|
||||
p, filePath, err)
|
||||
|
||||
Reference in New Issue
Block a user