fix: disallow file name too long when writing a file (#4881)

* fix: disallow file name too long when writing a file

* bool LongerName to MaxFilenameLength

---------

Co-authored-by: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.co>
This commit is contained in:
Konstantin Lebedev
2023-10-13 02:29:55 +05:00
committed by GitHub
parent edee91ef0e
commit 1cac5d983d
22 changed files with 340 additions and 262 deletions

View File

@@ -43,7 +43,7 @@ func (f *Filer) appendToFile(targetFile string, data []byte) error {
entry.Chunks = append(entry.GetChunks(), uploadResult.ToPbFileChunk(assignResult.Fid, offset, time.Now().UnixNano()))
// update the entry
err = f.CreateEntry(context.Background(), entry, false, false, nil, false)
err = f.CreateEntry(context.Background(), entry, false, false, nil, false, f.MaxFilenameLength)
return err
}