fix(filer.backup): local sink readonly permission (#8907)

This commit is contained in:
Jaehoon Kim
2026-04-03 21:36:56 +09:00
committed by GitHub
parent 91087c0737
commit d3cea714d0
2 changed files with 79 additions and 1 deletions

View File

@@ -93,7 +93,11 @@ func (localsink *LocalSink) CreateEntry(key string, entry *filer_pb.Entry, signa
}
mode := os.FileMode(entry.Attributes.FileMode)
dstFile, err := os.OpenFile(util.ToShortFileName(key), os.O_RDWR|os.O_CREATE|os.O_TRUNC, mode)
shortFileName := util.ToShortFileName(key)
if err := os.Remove(shortFileName); err != nil && !os.IsNotExist(err) {
return err
}
dstFile, err := os.OpenFile(shortFileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, mode)
if err != nil {
return err
}