From d64b938d61c14df9c1e4cbae8fd4b29985b2ee1d Mon Sep 17 00:00:00 2001 From: shaoying Date: Tue, 12 Feb 2019 11:14:34 +0800 Subject: [PATCH] fix right bug Change-Id: Ib5120b557c8426cd82b7dcada6dc1a177017b615 --- Makefile | 1 + src/contexts/ssh/ssh.go | 3 ++- src/contexts/tcp/tcp.go | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 449fd9c0..b933da55 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ shy: cp -r src/examples ~/context/src/ cp -r usr/template ~/context/usr/ cp -r usr/librarys/ ~/context/usr/ + cp -r bin ~/context tar: [ -e tar ] || mkdir tar diff --git a/src/contexts/ssh/ssh.go b/src/contexts/ssh/ssh.go index 0c47a577..417578bf 100644 --- a/src/contexts/ssh/ssh.go +++ b/src/contexts/ssh/ssh.go @@ -279,7 +279,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心", m.Append("user.name", m.Conf("runtime", "user.name")) m.Append("user.route", kit.Select(m.Conf("runtime", "node.route"), m.Conf("runtime", "user.route"))) } else { // 代理验证 - if arg[2] == m.Conf("runtime", "node.route") || m.Cmds("aaa.auth", "proxy", arg[2]) { + if arg[2] == m.Conf("runtime", "node.route") || m.Cmds("aaa.auth", "proxy", arg[2], "session") { m.Echo(m.Cmdx("aaa.rsa", "sign", m.Conf("runtime", "user.key"), arg[3])) } } @@ -395,6 +395,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心", // 代理验签 if !m.Options("user.cert") || !m.Options("user.sign") || !m.Cmds("aaa.rsa", "verify", m.Option("user.cert"), m.Option("user.sign"), hash) { m.Log("warn", "user error") + m.Echo("no right of %s", m.Option("text.route")) return } // 创建会话 diff --git a/src/contexts/tcp/tcp.go b/src/contexts/tcp/tcp.go index ec600dcf..6ea9d887 100644 --- a/src/contexts/tcp/tcp.go +++ b/src/contexts/tcp/tcp.go @@ -259,6 +259,9 @@ var Index = &ctx.Context{Name: "tcp", Help: "网络中心", if strings.Contains(ip[0], ":") || len(ip) == 0 { continue } + if len(v.HardwareAddr.String()) == 0 { + continue + } m.Add("append", "index", v.Index) m.Add("append", "name", v.Name)