Skip to content

Commit

Permalink
Fixing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
breathbath committed Apr 9, 2021
1 parent 0e99c27 commit e2a2c4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cmd/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,28 +179,28 @@ Any parameter passed are append to the ssh command. i.e. -b "-l root"`,
{
Field: controllers.LaunchRDP,
Description: `Start the default RDP client after the tunnel is established.
Optionally pass the rdp-width and rdp-height params of the session.`,
Optionally pass the rdp-width and rdp-height params for RDP window size`,
ShortName: "d",
Type: config.BoolRequirementType,
Default: "0",
},
{
Field: controllers.RDPWidth,
Description: `RDP window width, 1024 is the default`,
Description: `RDP window width`,
ShortName: "w",
Type: config.StringRequirementType,
Default: "1024",
},
{
Field: controllers.RDPHeight,
Description: `RDP window height, 768 is the default`,
Description: `RDP window height`,
ShortName: "i",
Type: config.StringRequirementType,
Default: "768",
},
{
Field: controllers.RDPUser,
Description: `[required] username for a RDP session`,
Description: `username for a RDP session`,
ShortName: "u",
Type: config.StringRequirementType,
Validate: config.RequiredValidate,
Expand Down
8 changes: 3 additions & 5 deletions internal/pkg/controllers/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"io/ioutil"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"

Expand Down Expand Up @@ -300,7 +299,7 @@ func (tc *TunnelController) startRDPFlow(
ScreenWidth: params.ReadInt(RDPWidth, 0),
UserName: params.ReadString(RDPUser, ""),
}
file, err := ioutil.TempFile("", "rport-*.rdp")
file, err := ioutil.TempFile(os.TempDir(), "rport-*.rdp")
if err != nil {
return err
}
Expand All @@ -312,7 +311,6 @@ func (tc *TunnelController) startRDPFlow(
return err
}

rdpFileLocation := filepath.Join(os.TempDir(), file.Name())
logrus.Debugf("written rdp file to %s", rdpFileLocation)
return tc.RDPExecutor.StartRdp(rdpFileLocation)
logrus.Infof("written rdp file to %s", file.Name())
return tc.RDPExecutor.StartRdp(file.Name())
}

0 comments on commit e2a2c4d

Please sign in to comment.