From eca991022ddc4bb8a64750da43e344b0e1d3d33f Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Fri, 8 May 2020 16:47:44 -0600 Subject: [PATCH] switch to suah.dev/protect --- go.mod | 8 ++++---- go.sum | 15 +++++++++++---- main.go | 10 +++++----- pu/pu.go | 17 ----------------- pu/pu_openbsd.go | 19 ------------------- 5 files changed, 20 insertions(+), 49 deletions(-) delete mode 100644 pu/pu.go delete mode 100644 pu/pu_openbsd.go diff --git a/go.mod b/go.mod index de55a28..ac2c673 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module suah.dev/gavin -go 1.13 +go 1.14 require ( - golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 - golang.org/x/net v0.0.0-20191105084925-a882066a44e0 - golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a + golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 + golang.org/x/net v0.0.0-20200506145744-7e3656a0809f + suah.dev/protect v0.0.0-20200508135532-408f86d55f26 ) diff --git a/go.sum b/go.sum index 8040b0e..c3a1425 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,14 @@ -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20191105084925-a882066a44e0 h1:QPlSTtPE2k6PZPasQUbzuK3p9JbS+vMXYVto8g/yrsg= -golang.org/x/net v0.0.0-20191105084925-a882066a44e0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 h1:IaQbIIB2X/Mp/DKctl6ROxz1KyMlKp4uyvL6+kQ7C88= +golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 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-20200323222414-85ca7c5b95cd/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= diff --git a/main.go b/main.go index c7226ab..ea6d25c 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "golang.org/x/crypto/bcrypt" "golang.org/x/net/webdav" - "suah.dev/gavin/pu" + "suah.dev/protect" ) var ( @@ -40,10 +40,10 @@ func init() { flag.Parse() // These are OpenBSD specific protections used to prevent un-necesary file access. - pu.Unveil(staticDir, "r") - pu.Unveil(passPath, "r") - pu.Unveil(davDir, "rwc") - err = pu.UnveilBlock() + protect.Unveil(staticDir, "r") + protect.Unveil(passPath, "r") + protect.Unveil(davDir, "rwc") + err = protect.UnveilBlock() if err != nil { log.Fatal(err) } diff --git a/pu/pu.go b/pu/pu.go deleted file mode 100644 index 7d24179..0000000 --- a/pu/pu.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build !openbsd - -package pu - -import "fmt" - -func Pledge(promisess string) { - return nil -} - -func Unveil(path string, perms string) { - return nil -} - -func UnveilBlock() error { - return nil -} diff --git a/pu/pu_openbsd.go b/pu/pu_openbsd.go deleted file mode 100644 index 42af282..0000000 --- a/pu/pu_openbsd.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build openbsd - -package pu - -import ( - "golang.org/x/sys/unix" -) - -func Pledge(promises string) { - unix.PledgePromises(promises) -} - -func Unveil(path string, perms string) { - unix.Unveil(path, perms) -} - -func UnveilBlock() error { - return unix.UnveilBlock() -}