Skip to content

Commit

Permalink
Merge pull request #44 from buildkite/keithduncan/add-trailing-new-line
Browse files Browse the repository at this point in the history
Append a trailing newline to secret keys before sending them to the ssh-agent
  • Loading branch information
keithduncan authored Jul 30, 2021
2 parents 7c42323 + f108c72 commit 922b375
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions s3secrets-helper/sshagent/sshagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (a *Agent) Add(key []byte) error {
return errors.New("Agent must Run() before Add()")
}
cmd := exec.Command("ssh-add", "-")
key = append(key, '\n')
cmd.Stdin = bytes.NewReader(key)
cmd.Env = []string{
"SSH_AGENT_PID=" + strconv.Itoa(a.pid),
Expand Down

0 comments on commit 922b375

Please sign in to comment.