Start using 1.0.0 of protect

This commit is contained in:
Aaron Bieber 2020-05-13 16:54:52 -06:00
parent 7971d61938
commit 57169e58ec
3 changed files with 10 additions and 13 deletions

1
go.mod
View File

@ -10,6 +10,5 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3
suah.dev/protect v1.0.0
)

6
go.sum
View File

@ -16,14 +16,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2eP
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 h1:5B6i6EAiSYyejWfvc5Rc9BbI3rzIsrrXfAQBWnYfn+w=
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
suah.dev/protect v0.0.0-20200508135532-408f86d55f26 h1:trB+FkW4IPwmiON5ipshh3y/7imr0Y+KRP1PRIne5k0=
suah.dev/protect v0.0.0-20200508135532-408f86d55f26/go.mod h1:ZSgyBM30JUwhVPWJzVHh0jlu5W6Qz1VR6tIhAzqJZ9Y=
suah.dev/protect v0.1.0 h1:ZHFEMrLULY8qH5EJSTiqgKvjsG7z3wXLBBmxbAonp6g=
suah.dev/protect v0.1.0/go.mod h1:ZSgyBM30JUwhVPWJzVHh0jlu5W6Qz1VR6tIhAzqJZ9Y=
suah.dev/protect v1.0.0 h1:X8pzDvDIZIiugmkmr6DES6JFO1XUdJWi34Ffmk6CMZY=
suah.dev/protect v1.0.0/go.mod h1:ZSgyBM30JUwhVPWJzVHh0jlu5W6Qz1VR6tIhAzqJZ9Y=

16
main.go
View File

@ -41,11 +41,15 @@ func main() {
flag.Parse()
protect.Pledge("stdio unveil rpath wpath cpath flock dns inet tty")
protect.Unveil("/etc/resolv.conf", "r")
protect.Unveil("/etc/ssl/cert.pem", "r")
protect.Unveil(db, "rwc")
protect.UnveilBlock()
_ = protect.Pledge("stdio unveil rpath wpath cpath flock dns inet tty")
_ = protect.Unveil("/etc/resolv.conf", "r")
_ = protect.Unveil("/etc/ssl/cert.pem", "r")
_ = protect.Unveil(db, "rwc")
var err = protect.UnveilBlock()
if err != nil {
log.Fatal(err)
}
var help = `^help: (\w+)$`
var helpRE = regexp.MustCompile(help)
@ -123,7 +127,7 @@ func main() {
}
// No longer need tty now that we have our info
protect.Pledge("stdio unveil rpath wpath cpath flock dns inet")
_ = protect.Pledge("stdio unveil rpath wpath cpath flock dns inet")
store.Set("username", username)
store.Set("access_token", resp.AccessToken)