sftpd: add support for chtimes

This improve rclone compatibility
This commit is contained in:
Nicola Murino
2019-11-16 10:23:41 +01:00
parent fc442d7862
commit ca6cb34d98
9 changed files with 167 additions and 27 deletions

View File

@@ -150,7 +150,7 @@ func TransferLog(operation string, path string, elapsed int64, size int64, user
}
// CommandLog logs an SFTP/SCP command
func CommandLog(command, path, target, user, fileMode, connectionID, protocol string, uid, gid int) {
func CommandLog(command, path, target, user, fileMode, connectionID, protocol string, uid, gid int, atime, mtime string) {
logger.Info().
Timestamp().
Str("sender", command).
@@ -160,6 +160,8 @@ func CommandLog(command, path, target, user, fileMode, connectionID, protocol st
Str("filemode", fileMode).
Int("uid", uid).
Int("gid", gid).
Str("access_time", atime).
Str("modification_time", atime).
Str("connection_id", connectionID).
Str("protocol", protocol).
Msg("")