From 7f698c89346acb5e5116736d25325a046652ba81 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 28 Jun 2023 08:56:35 +0200 Subject: Don't panic on invalid security whitelist regexp Fixes #11176 --- hugolib/integrationtest_builder.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hugolib/integrationtest_builder.go') diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go index cb34cb28b..9c40fa7d0 100644 --- a/hugolib/integrationtest_builder.go +++ b/hugolib/integrationtest_builder.go @@ -381,7 +381,8 @@ func (s *IntegrationTestBuilder) initBuilder() error { s.Assert(os.Chdir(s.Cfg.WorkingDir), qt.IsNil) s.C.Cleanup(func() { os.Chdir(wd) }) sc := security.DefaultConfig - sc.Exec.Allow = security.NewWhitelist("npm") + 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) -- cgit v1.2.3