aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/unveil_openbsd.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
committerLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
commit8db41da676ac8368ef7c2549d56239a5ff5eedde (patch)
tree09c427fd66de2ec1ebffc8342f5fdbb84b0701b5 /vendor/golang.org/x/sys/unix/unveil_openbsd.go
parentd4f75fb6db22e57577867445a022227e70958931 (diff)
downloadgitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.tar.gz
gitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.zip
Delete vendor directory
Diffstat (limited to 'vendor/golang.org/x/sys/unix/unveil_openbsd.go')
-rw-r--r--vendor/golang.org/x/sys/unix/unveil_openbsd.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/vendor/golang.org/x/sys/unix/unveil_openbsd.go b/vendor/golang.org/x/sys/unix/unveil_openbsd.go
deleted file mode 100644
index cb7e598..0000000
--- a/vendor/golang.org/x/sys/unix/unveil_openbsd.go
+++ /dev/null
@@ -1,51 +0,0 @@
1// Copyright 2018 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package unix
6
7import "fmt"
8
9// Unveil implements the unveil syscall.
10// For more information see unveil(2).
11// Note that the special case of blocking further
12// unveil calls is handled by UnveilBlock.
13func Unveil(path string, flags string) error {
14 if err := supportsUnveil(); err != nil {
15 return err
16 }
17 pathPtr, err := BytePtrFromString(path)
18 if err != nil {
19 return err
20 }
21 flagsPtr, err := BytePtrFromString(flags)
22 if err != nil {
23 return err
24 }
25 return unveil(pathPtr, flagsPtr)
26}
27
28// UnveilBlock blocks future unveil calls.
29// For more information see unveil(2).
30func UnveilBlock() error {
31 if err := supportsUnveil(); err != nil {
32 return err
33 }
34 return unveil(nil, nil)
35}
36
37// supportsUnveil checks for availability of the unveil(2) system call based
38// on the running OpenBSD version.
39func supportsUnveil() error {
40 maj, min, err := majmin()
41 if err != nil {
42 return err
43 }
44
45 // unveil is not available before 6.4
46 if maj < 6 || (maj == 6 && min <= 3) {
47 return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min)
48 }
49
50 return nil
51}