Commit 24dd3c40 authored by Eric's avatar Eric Committed by Eric_Lee

fix bug: systemuser

parent 4ba06008
...@@ -201,7 +201,9 @@ func GetClientFromCache(user *model.User, asset *model.Asset, systemUser *model. ...@@ -201,7 +201,9 @@ func GetClientFromCache(user *model.User, asset *model.Asset, systemUser *model.
if !ok { if !ok {
return return
} }
if systemUser.Username == ""{
systemUser.Username = client.Username
}
var u = user.Username var u = user.Username
var ip = asset.IP var ip = asset.IP
clientsRefCounter[client]++ clientsRefCounter[client]++
......
...@@ -78,9 +78,7 @@ func (sc *ServerSSHConnection) TryConnectFromCache(h, w int, term string) (err e ...@@ -78,9 +78,7 @@ func (sc *ServerSSHConnection) TryConnectFromCache(h, w int, term string) (err e
if sc.client == nil { if sc.client == nil {
return errors.New("no client in cache") return errors.New("no client in cache")
} }
if sc.SystemUser.Username == "" {
sc.SystemUser.Username = sc.client.Username
}
err = sc.invokeShell(h, w, term) err = sc.invokeShell(h, w, term)
if err != nil { if err != nil {
RecycleClient(sc.client) RecycleClient(sc.client)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment