mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
#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
1 changed files with 7 additions and 0 deletions
|
@ -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 a new issue