refactor SFTP backend to use upstream dep, not our fork#23786
refactor SFTP backend to use upstream dep, not our fork#23786capnspacehook merged 7 commits intomasterfrom
Conversation
96e604b to
665074c
Compare
This change also greatly reduces the number of SFTP audit logs. Now SFTP events are only sent when files are opened or modified in any way, instead of for *every* SFTP request.
665074c to
d1cb50e
Compare
| } | ||
|
|
||
| err := os.MkdirAll(path, mode) | ||
| err := os.MkdirAll(path, 0o755) |
There was a problem hiding this comment.
Why are we no longer passing the mode but hardcoding it to 755 and 644 everywhere?
There was a problem hiding this comment.
Modifications in our sftp fork allowed us to do that before, now we have to call Chmod directly after creating a file
There was a problem hiding this comment.
@capnspacehook Can you backport your mkdir implementation upstream? I think that it should be accepted, and then the chmod trick won't be needed.
CC @r0mant
| if !ok { | ||
| // We don't care about this type of SFTP request, move on | ||
| // Filecmd handles file modification requests. | ||
| func (s *sftpHandler) Filecmd(req *sftp.Request) (retErr error) { |
There was a problem hiding this comment.
It's a shame we basically have to reimplement these command handlers ourselves. Are there no "default handlers" somewhere in the sftp package we could wrap to add auditing?
There was a problem hiding this comment.
Nope, the closest thing is in-memory handlers for implementing a VFS which we obviously don't want
|
Friendly ping @greedy52 |
This change also greatly reduces the number of SFTP audit logs. Now SFTP events are only sent when files are opened or modified in any way, instead of for every SFTP request.
Fixes #21518.
Closes #22932.