all repos — legit @ 892ba7e5f3dbaf79b12a457f9ee6191df56625a3

web frontend for git

unveil.go (view raw)

 1//go:build openbsd
 2// +build openbsd
 3
 4package main
 5
 6import (
 7	"golang.org/x/sys/unix"
 8	"log"
 9)
10
11func Unveil(path string, perms string) error {
12	log.Printf("unveil: \"%s\", %s", path, perms)
13	return unix.Unveil(path, perms)
14}
15
16func UnveilBlock() error {
17	log.Printf("unveil: block")
18	return unix.UnveilBlock()
19}
20
21func UnveilPaths(paths []string, perms string) error {
22	for _, path := range paths {
23		if err := Unveil(path, perms); err != nil {
24			return err
25		}
26	}
27	return UnveilBlock()
28}