Skip to content

Commit

Permalink
Don't print an error message on shell exit.
Browse files Browse the repository at this point in the history
If a shell has been successfully started, don't print an error message
saying the shell failed to start if it exits with exit code other than
0. If an error occured during shell execution or the shell will print
the message itself and exit with an error.
  • Loading branch information
russjones committed Dec 10, 2019
1 parent 42ec959 commit 4253b88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/srv/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,13 @@ func RunCommand() {
errorAndExit(errorWriter, teleport.RemoteCommandFailure, err)
}

// Wait for it to exit.
// Wait for the command to exit. It doesn't make sense to print an error
// message here because the shell has successfully started. If an error
// occured during shell execution or the shell exits with an error (like
// running exit 2), the shell will print an error if appropriate and return
// an exit code.
err = cmd.Wait()
errorAndExit(errorWriter, exitCode(err), err)
os.Exit(exitCode(err))
}

func (e *localExec) transformSecureCopy() error {
Expand Down

0 comments on commit 4253b88

Please sign in to comment.