summary refs log blame commit diff stats
path: root/pledge.go
blob: dc385cb415d669a8348908b3fc842a062914a6be (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                   
                                                                  






                                            
package main

import (
	"fmt"
	"os"

	"tildegit.org/andinus/lynx"
)

// initPledge initializes pledge for initial use.
func initPledge() {
	// Pledge promises can only be dropped & we cannot add
	// anything so this call adds everything that maybe used in
	// program later. We don't define execpromises here because
	// that comes from the user.
	//
	// Note: Don't forget to change blockUnveil() if you add
	// anything new here.
	err := lynx.PledgePromises("unveil stdio rpath exec proc")
	if err != nil {
		fmt.Printf("%s :: %s",
			"initPledge failed",
			err.Error())
		os.Exit(1)
	}
}