summaryrefslogblamecommitdiffstats
path: root/unveil.go
blob: 9fe5e10fe63438aebbb5ead9cb28a280c3baace1 (plain) (tree)
1
2
3
4
5
6
7
8




                  
        
                               
             


                                              
                                                     



                                       
                                   

                                 
 





                                                      
         
                            
 
//go:build openbsd
// +build openbsd

package main

import (
	"golang.org/x/sys/unix"
	"log"
)

func Unveil(path string, perms string) error {
	log.Printf("unveil: \"%s\", %s", path, perms)
	return unix.Unveil(path, perms)
}

func UnveilBlock() error {
	log.Printf("unveil: block")
	return unix.UnveilBlock()
}

func UnveilPaths(paths []string, perms string) error {
	for _, path := range paths {
		err := Unveil(path, perms)
		if err != nil {
			return err
		}
	}
	return UnveilBlock()
}