From 98be591b3c0bff65a2555ec1648bfa8bf79cfc22 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 30 May 2018 17:00:32 +0200 Subject: [PATCH] Replace -allow-connect and -allow-accept with -allow-net --- fetch.go | 4 ++-- main.go | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/fetch.go b/fetch.go index e505776cb5..3b9cb57465 100644 --- a/fetch.go +++ b/fetch.go @@ -31,8 +31,8 @@ func Fetch(id int32, targetUrl string) []byte { FetchResId: id, } - if !Perms.Connect { - resMsg.Error = "Permission to connect denied." + if !Perms.Net { + resMsg.Error = "Network access denied." PubMsg("fetch", resMsg) return } diff --git a/main.go b/main.go index 7da8cfd077..6bb28fd49d 100644 --- a/main.go +++ b/main.go @@ -15,27 +15,23 @@ var flagV8Options = flag.Bool("v8-options", false, "Print V8 command line option var flagDebug = flag.Bool("debug", false, "Enable debug output.") var flagGoProf = flag.String("goprof", "", "Write golang cpu profile to file.") -var flagAllowWrite = flag.Bool("allow-write", false, - "Allow program to write to the fs.") -var flagAllowConnect = flag.Bool("allow-connect", false, - "Allow program to connect to other network addresses.") -var flagAllowAccept = flag.Bool("allow-accept", false, - "Allow program to accept connections.") var flagAllowRead = flag.Bool("allow-read", true, "Allow program to read file system.") +var flagAllowWrite = flag.Bool("allow-write", false, + "Allow program to write to the fs.") +var flagAllowNet = flag.Bool("allow-net", false, + "Allow program to make network connection.") var Perms struct { FsRead bool FsWrite bool - Connect bool - Accept bool + Net bool } func setPerms() { Perms.FsRead = *flagAllowRead Perms.FsWrite = *flagAllowWrite - Perms.Connect = *flagAllowConnect - Perms.Accept = *flagAllowAccept + Perms.Net = *flagAllowNet } func stringAsset(path string) string {