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:
@@ -93,7 +93,7 @@ func (c *Connection) getFileReader(name string, offset int64, method string) (io
|
||||
}
|
||||
|
||||
if method != http.MethodHead {
|
||||
if err := common.ExecutePreAction(&c.User, common.OperationPreDownload, p, name, c.GetProtocol(), 0); err != nil {
|
||||
if err := common.ExecutePreAction(&c.User, common.OperationPreDownload, p, name, c.GetProtocol(), 0, 0); err != nil {
|
||||
c.Log(logger.LevelDebug, "download for file %#v denied by pre action: %v", name, err)
|
||||
return nil, c.GetPermissionDeniedError()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user