Plugins: Unsigned chromium file should not invalidate signature for Renderer plugin (#59104)

* Plugins: Unsigned chromium file should not invalidate signature for Renderer plugin

* fix test

* re-work solution
This commit is contained in:
Will Browne
2022-12-19 12:46:27 +01:00
committed by GitHub
parent 02fbb1cd8f
commit 48b33ab521
7 changed files with 77 additions and 11 deletions
-11
View File
@@ -7,7 +7,6 @@ import (
"math"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"sync"
@@ -170,16 +169,6 @@ func (rs *RenderingService) Run(ctx context.Context) error {
rs.sanitizeSVGAction = rs.sanitizeSVGViaPlugin
<-ctx.Done()
// On Windows, Chromium is generating a debug.log file that breaks signature check on next restart
debugFilePath := path.Join(rs.pluginInfo.PluginDir, "chrome-win/debug.log")
if _, err := os.Stat(debugFilePath); err == nil {
err = os.Remove(debugFilePath)
if err != nil {
rs.log.Warn("Couldn't remove debug.log file, the renderer plugin will not be able to pass the signature check until this file is deleted",
"err", err)
}
}
return nil
}