summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-15 19:56:06 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-15 19:56:06 +0200
commit4312a7c70a58656891ff1398f2d0d36f4ed74c8a (patch)
tree01a360daff9225301520784b9b2097522c261667
parentLock timers on modification (diff)
downloadwireguard-go-4312a7c70a58656891ff1398f2d0d36f4ed74c8a.tar.xz
wireguard-go-4312a7c70a58656891ff1398f2d0d36f4ed74c8a.zip
Temporary work around. Please revert me
-rw-r--r--tun_darwin.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/tun_darwin.go b/tun_darwin.go
index ed055b2..04badd9 100644
--- a/tun_darwin.go
+++ b/tun_darwin.go
@@ -15,6 +15,7 @@ import (
"io/ioutil"
"net"
"os"
+ "path/filepath"
"time"
"unsafe"
)
@@ -107,6 +108,7 @@ func CreateTUN(name string) (TUNDevice, error) {
if err == nil && name == "utun" {
fname := os.Getenv("WG_DARWIN_UTUN_NAME_FILE")
if fname != "" {
+ os.MkdirAll(filepath.Dir(fname), 0700)
ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
}
}