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.
if !ok {
return
}
if systemUser.Username == ""{
systemUser.Username = client.Username
}
var u = user.Username
var ip = asset.IP
clientsRefCounter[client]++
......
......@@ -78,9 +78,7 @@ func (sc *ServerSSHConnection) TryConnectFromCache(h, w int, term string) (err e
if sc.client == nil {
return errors.New("no client in cache")
}
if sc.SystemUser.Username == "" {
sc.SystemUser.Username = sc.client.Username
}
err = sc.invokeShell(h, w, term)
if err != nil {
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