~egtann/shh

ref: v1.9.0 shh/security_openbsd.go -rw-r--r-- 491 bytes
53855162 — Evan Tann update install instructions, add man page 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import "golang.org/x/sys/unix"

// pledge restricts shh to very limited syscalls.
func pledge(promises, execPromises string) {
	if err := unix.Pledge(promises, execPromises); err != nil {
		panic(err)
	}
}

// unveil restricts shh to very limited (read-only) filesystem access.
func unveil(filepath string, perm string) {
	if err := unix.Unveil(filepath, perm); err != nil {
		panic(err)
	}
}

func unveilBlock() {
	if err := unix.UnveilBlock(); err != nil {
		panic(err)
	}
}