Temporary work around. Please revert me

This commit is contained in:
Jason A. Donenfeld 2018-05-15 19:56:06 +02:00
parent 207fd644e8
commit 4312a7c70a

View File

@ -15,6 +15,7 @@ import (
"io/ioutil" "io/ioutil"
"net" "net"
"os" "os"
"path/filepath"
"time" "time"
"unsafe" "unsafe"
) )
@ -107,6 +108,7 @@ func CreateTUN(name string) (TUNDevice, error) {
if err == nil && name == "utun" { if err == nil && name == "utun" {
fname := os.Getenv("WG_DARWIN_UTUN_NAME_FILE") fname := os.Getenv("WG_DARWIN_UTUN_NAME_FILE")
if fname != "" { if fname != "" {
os.MkdirAll(filepath.Dir(fname), 0700)
ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400) ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
} }
} }