Skip to content

Commit 45bd452

Browse files
committed
force cli path to be absolute
1 parent ee99527 commit 45bd452

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cli/configssh.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,15 @@ func (r *RootCmd) configSSH() *clibase.Cmd {
512512
Flag: "coder-cli-path",
513513
Env: "CODER_SSH_CONFIG_CLI_PATH",
514514
Default: "",
515-
Description: "Optional to specify the path for the coder cli uses in ProxyCommand. " +
515+
Description: "Optional to specify the absolute path for the coder cli uses in ProxyCommand. " +
516516
"By default, the coder cli used is the same cli being invoked with 'config ssh'.",
517-
Value: clibase.StringOf(&coderCliPath),
517+
Value: clibase.Validate(clibase.StringOf(&coderCliPath), func(value *clibase.String) error {
518+
absolute := filepath.IsAbs(value.String())
519+
if !absolute {
520+
return xerrors.Errorf("coder cli path must be an absolute path")
521+
}
522+
return nil
523+
}),
518524
},
519525
{
520526
Flag: "ssh-option",

0 commit comments

Comments
 (0)