all repos — legit @ 5dc6516d74885ce3f03db9dd997da2e11517b8f7

web frontend for git, written in go

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}