Skip to content

Commit

Permalink
fix: 处理username有\的域账号
Browse files Browse the repository at this point in the history
  • Loading branch information
feng626 committed Aug 23, 2023
1 parent 48675ba commit 91093e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/session/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package session
import (
"path/filepath"
"strconv"
"strings"

"lion/pkg/common"
"lion/pkg/config"
Expand Down Expand Up @@ -55,6 +56,11 @@ func (r RDPConfiguration) GetGuacdConfiguration() guacd.Configuration {
if r.Platform != nil {
if rdpSetting, ok := r.Platform.GetProtocolSetting("rdp"); ok {
if rdpSetting.Setting.AdDomain != "" {
parts := strings.Split(username, `\`)
if len(parts) == 2 {
username = parts[1] + "@" + parts[0]
}
conf.SetParameter(guacd.RDPUsername, username)
conf.SetParameter(guacd.RDPDomain, rdpSetting.Setting.AdDomain)
}
}
Expand Down

0 comments on commit 91093e8

Please sign in to comment.