mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
add Data At Rest Encryption support
This commit is contained in:
@@ -365,7 +365,11 @@ func (c *Connection) handleFTPUploadToExistingFile(flags int, resolvedPath, file
|
||||
return nil, common.ErrQuotaExceeded
|
||||
}
|
||||
minWriteOffset := int64(0)
|
||||
isResume := flags&os.O_APPEND != 0 && flags&os.O_TRUNC == 0
|
||||
// ftpserverlib set os.O_WRONLY | os.O_APPEND for APPE
|
||||
// and os.O_WRONLY | os.O_CREATE for REST. If is not APPE
|
||||
// and REST = 0 then os.O_WRONLY | os.O_CREATE | os.O_TRUNC
|
||||
// so if we don't have O_TRUC is a resume
|
||||
isResume := flags&os.O_TRUNC == 0
|
||||
// if there is a size limit remaining size cannot be 0 here, since quotaResult.HasSpace
|
||||
// will return false in this case and we deny the upload before
|
||||
maxWriteSize, err := c.GetMaxWriteSize(quotaResult, isResume, fileSize)
|
||||
|
||||
Reference in New Issue
Block a user