use separate backend hooks with tighter pledge
This commit is contained in:
parent
c77ef4636c
commit
5435dd1b3f
2 changed files with 6 additions and 1 deletions
|
@ -73,6 +73,8 @@ func shrinkit(data []byte) (*image.Image, error) {
|
|||
return res.Image, nil
|
||||
}
|
||||
|
||||
var backendhooks []func()
|
||||
|
||||
func backendServer() {
|
||||
log.Printf("backend server running")
|
||||
shrinker := new(Shrinker)
|
||||
|
@ -92,7 +94,7 @@ func backendServer() {
|
|||
if err != nil {
|
||||
log.Panicf("unable to register shrinker: %s", err)
|
||||
}
|
||||
for _, h := range preservehooks {
|
||||
for _, h := range backendhooks {
|
||||
h()
|
||||
}
|
||||
srv.Accept(lis)
|
||||
|
|
|
@ -62,4 +62,7 @@ func init() {
|
|||
C.unveil(nil, nil)
|
||||
Pledge("stdio rpath wpath cpath flock dns inet unix")
|
||||
})
|
||||
backendhooks = append(backendhooks, func() {
|
||||
Pledge("stdio unix")
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue