unveil crossbuild

pull/1/head
vasyahacker 2023-03-31 17:15:01 +04:00
parent 5f17b76832
commit 890f803693
3 changed files with 34 additions and 9 deletions

View File

@ -11,7 +11,6 @@ import (
"strings"
"path/filepath"
"errors"
"golang.org/x/sys/unix"
)
func open_db(path string) *ii.DB {
@ -116,14 +115,14 @@ func main() {
*style_path_opt)
}
unix.Unveil(*tpl_path_opt, "r")
unix.Unveil(*style_path_opt, "r")
unix.Unveil(*echo_opt, "r")
unix.Unveil(*users_opt, "rwc")
unix.Unveil(filepath.Dir(*db_opt), "rwc")
unix.Unveil(*db_opt + ".idx", "rwc")
unix.Unveil(os.TempDir(), "rwc")
unix.UnveilBlock()
unveil(*tpl_path_opt, "r")
unveil(*style_path_opt, "r")
unveil(*echo_opt, "r")
unveil(*users_opt, "rwc")
unveil(filepath.Dir(*db_opt), "rwc")
unveil(*db_opt + ".idx", "rwc")
unveil(os.TempDir(), "rwc")
unveil_block()
db := open_db(*db_opt)
edb := ii.LoadEcholist(*echo_opt)

View File

@ -0,0 +1,14 @@
//go:build openbsd
// +build openbsd
package main
import "golang.org/x/sys/unix"
func unveil(path string, permissions string) error {
return unix.Unveil(path, permissions)
}
func unveil_block() error {
return unix.UnveilBlock()
}

12
cmd/idecd/unveil_other.go Normal file
View File

@ -0,0 +1,12 @@
//go:build !openbsd
// +build !openbsd
package main
func unveil(path string, permissions string) error {
return nil
}
func unveil_block() error {
return nil
}