Skip to content

Commit

Permalink
add permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
timest committed Nov 6, 2017
1 parent 65c48fd commit aa927d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func sendARP() {
}

func main() {
if os.Getuid() != 0 {
log.Fatal("goscan must run as root.")
}
flag.StringVar(&iface, "I", "", "Network interface name")
flag.Parse()
// 初始化 data
Expand Down

0 comments on commit aa927d4

Please sign in to comment.