sftpd: add support for chmod/chown

added matching permissions too and a new setting "setstat_mode".
Setting setstat_mode to 1 you can keep the previous behaviour that
silently ignore setstat requests
This commit is contained in:
Nicola Murino
2019-11-15 12:15:07 +01:00
parent 206799ff1c
commit bb37a1c1ce
13 changed files with 291 additions and 101 deletions

View File

@@ -150,13 +150,16 @@ func TransferLog(operation string, path string, elapsed int64, size int64, user
}
// CommandLog logs an SFTP/SCP command
func CommandLog(command string, path string, target string, user string, connectionID string, protocol string) {
func CommandLog(command, path, target, user, fileMode, connectionID, protocol string, uid, gid int) {
logger.Info().
Timestamp().
Str("sender", command).
Str("username", user).
Str("file_path", path).
Str("target_path", target).
Str("filemode", fileMode).
Int("uid", uid).
Int("gid", gid).
Str("connection_id", connectionID).
Str("protocol", protocol).
Msg("")