mirror of https://gogs.blitter.com/RLabs/xs
#3: hkexshd: server should output error on startup if not run w/sufficient privileges
Signed-off-by: Russ Magee <rmagee@gmail.com>
This commit is contained in:
parent
dac467c1e6
commit
011f6d161b
|
@ -200,6 +200,13 @@ func main() {
|
||||||
log.SetOutput(ioutil.Discard)
|
log.SetOutput(ioutil.Discard)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
me, e := user.Current()
|
||||||
|
if e != nil || me.Uid != "0" {
|
||||||
|
log.Fatal("Must run as root.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Listen on TCP port 2000 on all available unicast and
|
// Listen on TCP port 2000 on all available unicast and
|
||||||
// anycast IP addresses of the local system.
|
// anycast IP addresses of the local system.
|
||||||
l, err := hkexsh.Listen("tcp", laddr)
|
l, err := hkexsh.Listen("tcp", laddr)
|
||||||
|
|
Loading…
Reference in New Issue