Fix OpenBSD pledges (#111)

- Change call from 'unix.Pledge' to 'unix.PledgePromises' to prevent subprocesses (gpg) from
  being already locked (execpromises="")
- New pledges needed for syslog: unix + tty
This commit is contained in:
Guillermo Ramos 2021-10-23 19:24:44 +02:00 committed by GitHub
parent 6d992ca214
commit 8e32908ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ func main() {
os.Exit(0)
}
openbsd.Pledge("stdio rpath proc exec getpw")
openbsd.Pledge("stdio rpath proc exec getpw unix tty")
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
if isVerbose {

View File

@ -6,5 +6,5 @@ import "golang.org/x/sys/unix"
// Pledge allowed system calls
func Pledge(promises string) {
unix.Pledge(promises, "")
unix.PledgePromises(promises)
}