mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(webconsole): rdp 用户隔离上传文件 (#18920)
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
"net"
|
||||
)
|
||||
|
||||
func NewGuacamoleTunnel(host string, port int, user, password string, id string, w, h, dpi int) (*GuacamoleTunnel, error) {
|
||||
func NewGuacamoleTunnel(host string, port int, user, password string, id string, w, h, dpi int, uId string) (*GuacamoleTunnel, error) {
|
||||
opts := NewGuacOptions()
|
||||
opts.ConnectionId = id
|
||||
opts.Protocol = "rdp"
|
||||
@@ -41,7 +41,7 @@ func NewGuacamoleTunnel(host string, port int, user, password string, id string,
|
||||
"password": password,
|
||||
"enable-drive": "true",
|
||||
"drive-name": "Cloudpods",
|
||||
"drive-path": "/opt/cloudpods",
|
||||
"drive-path": "/opt/cloudpods/" + uId,
|
||||
"create-drive-path": "true",
|
||||
}
|
||||
conn, err := net.Dial("tcp", "127.0.0.1:4822")
|
||||
|
||||
@@ -78,7 +78,17 @@ func (s *RDPServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
defer ws.Close()
|
||||
|
||||
tunnel, err := guac.NewGuacamoleTunnel(s.Host, s.Port, s.Username, s.Password, s.ConnectionId, s.Width, s.Height, s.Dpi)
|
||||
tunnel, err := guac.NewGuacamoleTunnel(
|
||||
s.Host,
|
||||
s.Port,
|
||||
s.Username,
|
||||
s.Password,
|
||||
s.ConnectionId,
|
||||
s.Width,
|
||||
s.Height,
|
||||
s.Dpi,
|
||||
s.Session.GetClientSession().GetUserId(),
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf("NewGuacamoleTunnel error: %v", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user