internal/build: accept any host key for SFTP

This is OK because transport security isn't important for Launchpad
uploads. We're using SFTP as a replacement for unencrypted FTP and files
we upload are signed using GPG.
This commit is contained in:
Felix Lange 2019-02-18 09:55:09 +01:00
parent 50b872bf05
commit 690b5e3062

View file

@ -182,7 +182,7 @@ func ExpandPackagesNoVendor(patterns []string) []string {
// The destination host may be specified either as [user@]host[: or as a URI in
// the form sftp://[user@]host[:port].
func UploadSFTP(identityFile, host, dir string, files []string) error {
sftp := exec.Command("sftp")
sftp := exec.Command("sftp", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null")
sftp.Stdout = nil
sftp.Stderr = os.Stderr
if identityFile != "" {