aboutsummaryrefslogtreecommitdiffstats
path: root/uapi_bsd.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-23 15:38:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-23 15:38:24 +0200
commit0b647d1ca7e079f3bb2fe95c3ca7c05898315a6e (patch)
treeb73f8cf72b4cda0eb218cceef76bf978a58e8704 /uapi_bsd.go
parentAdopt GOPATH (diff)
downloadwireguard-go-0b647d1ca7e079f3bb2fe95c3ca7c05898315a6e.tar.xz
wireguard-go-0b647d1ca7e079f3bb2fe95c3ca7c05898315a6e.zip
Infoleak ifnames and be more permissive
Listing interfaces is already permitted by the OS, so we allow this info leak too.
Diffstat (limited to '')
-rw-r--r--uapi_bsd.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/uapi_bsd.go b/uapi_bsd.go
index b2a7644..bb16d2c 100644
--- a/uapi_bsd.go
+++ b/uapi_bsd.go
@@ -150,7 +150,7 @@ func UAPIOpen(name string) (*os.File, error) {
// check if path exist
- err := os.MkdirAll(socketDirectory, 0700)
+ err := os.MkdirAll(socketDirectory, 0755)
if err != nil && !os.IsExist(err) {
return nil, err
}
@@ -167,6 +167,7 @@ func UAPIOpen(name string) (*os.File, error) {
return nil, err
}
+ oldUmask := unix.Umask(0077)
listener, err := func() (*net.UnixListener, error) {
// initial connection attempt
@@ -191,6 +192,7 @@ func UAPIOpen(name string) (*os.File, error) {
}
return net.ListenUnix("unix", addr)
}()
+ unix.Umask(oldUmask)
if err != nil {
return nil, err