Don't panic on invalid security whitelist regexp

Fixes #11176
This commit is contained in:
Bjørn Erik Pedersen
2023-06-28 08:56:35 +02:00
parent fa0e16f4c7
commit 7f698c8934
7 changed files with 39 additions and 21 deletions

View File

@@ -834,7 +834,9 @@ func (s *sitesBuilder) GetPageRel(p page.Page, ref string) page.Page {
func (s *sitesBuilder) NpmInstall() hexec.Runner {
sc := security.DefaultConfig
sc.Exec.Allow = security.NewWhitelist("npm")
var err error
sc.Exec.Allow, err = security.NewWhitelist("npm")
s.Assert(err, qt.IsNil)
ex := hexec.New(sc)
command, err := ex.New("npm", "install")
s.Assert(err, qt.IsNil)