fix: avoid error file name too long when writing a file (#4876)

This commit is contained in:
Konstantin Lebedev
2023-09-27 17:40:51 +05:00
committed by GitHub
parent 9d589b48e6
commit 44906f1f3b
4 changed files with 43 additions and 4 deletions

View File

@@ -90,7 +90,7 @@ func (localsink *LocalSink) CreateEntry(key string, entry *filer_pb.Entry, signa
return os.Mkdir(key, os.FileMode(entry.Attributes.FileMode))
}
dstFile, err := os.OpenFile(key, os.O_RDWR|os.O_CREATE|os.O_TRUNC, os.FileMode(entry.Attributes.FileMode))
dstFile, err := os.OpenFile(util.ToShortFileName(key), os.O_RDWR|os.O_CREATE|os.O_TRUNC, os.FileMode(entry.Attributes.FileMode))
if err != nil {
return err
}