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

@@ -29,6 +29,8 @@ const (
mkdirLogSender = "Mkdir"
symlinkLogSender = "Symlink"
removeLogSender = "Remove"
chownLogSender = "Chown"
chmodLogSender = "Chmod"
operationDownload = "download"
operationUpload = "upload"
operationDelete = "delete"
@@ -54,6 +56,7 @@ var (
dataProvider dataprovider.Provider
actions Actions
uploadMode int
setstatMode int
)
type connectionTransfer struct {
@@ -103,6 +106,10 @@ type ConnectionStatus struct {
Transfers []connectionTransfer `json:"active_transfers"`
}
type sshSubsystemExitStatus struct {
Status uint32
}
func init() {
openConnections = make(map[string]Connection)
idleConnectionTicker = time.NewTicker(5 * time.Minute)