mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
Replace -allow-connect and -allow-accept with -allow-net
This commit is contained in:
parent
871a8e05ec
commit
98be591b3c
2 changed files with 8 additions and 12 deletions
4
fetch.go
4
fetch.go
|
@ -31,8 +31,8 @@ func Fetch(id int32, targetUrl string) []byte {
|
||||||
FetchResId: id,
|
FetchResId: id,
|
||||||
}
|
}
|
||||||
|
|
||||||
if !Perms.Connect {
|
if !Perms.Net {
|
||||||
resMsg.Error = "Permission to connect denied."
|
resMsg.Error = "Network access denied."
|
||||||
PubMsg("fetch", resMsg)
|
PubMsg("fetch", resMsg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
16
main.go
16
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 flagDebug = flag.Bool("debug", false, "Enable debug output.")
|
||||||
var flagGoProf = flag.String("goprof", "", "Write golang cpu profile to file.")
|
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,
|
var flagAllowRead = flag.Bool("allow-read", true,
|
||||||
"Allow program to read file system.")
|
"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 {
|
var Perms struct {
|
||||||
FsRead bool
|
FsRead bool
|
||||||
FsWrite bool
|
FsWrite bool
|
||||||
Connect bool
|
Net bool
|
||||||
Accept bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setPerms() {
|
func setPerms() {
|
||||||
Perms.FsRead = *flagAllowRead
|
Perms.FsRead = *flagAllowRead
|
||||||
Perms.FsWrite = *flagAllowWrite
|
Perms.FsWrite = *flagAllowWrite
|
||||||
Perms.Connect = *flagAllowConnect
|
Perms.Net = *flagAllowNet
|
||||||
Perms.Accept = *flagAllowAccept
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func stringAsset(path string) string {
|
func stringAsset(path string) string {
|
||||||
|
|
Loading…
Add table
Reference in a new issue