mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
pre-upload action: add file open flags
Reading the flags the hook receiver can detect if the client wants to truncate the target file
This commit is contained in:
@@ -148,7 +148,7 @@ func (f *webDavFile) Read(p []byte) (n int, err error) {
|
||||
return 0, f.Connection.GetPermissionDeniedError()
|
||||
}
|
||||
err := common.ExecutePreAction(&f.Connection.User, common.OperationPreDownload, f.GetFsPath(), f.GetVirtualPath(),
|
||||
f.Connection.GetProtocol(), 0)
|
||||
f.Connection.GetProtocol(), 0, 0)
|
||||
if err != nil {
|
||||
f.Connection.Log(logger.LevelDebug, "download for file %#v denied by pre action: %v", f.GetVirtualPath(), err)
|
||||
return 0, f.Connection.GetPermissionDeniedError()
|
||||
|
||||
Reference in New Issue
Block a user