all repos — legit @ 45d1c6c2ecf2f53f468d1eeef46aecb749e7086d

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		err := Unveil(path, perms)
24		if err != nil {
25			return err
26		}
27	}
28	return UnveilBlock()
29}