From 1c60a968ff0c678a6e286db95870947b01af0b7b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 16 Apr 2014 10:03:46 +0000 Subject: Run ssh via a wrapper that disables host key checking, for CVS --- lorry | 8 ++++++-- lorry-ssh-wrapper | 5 +++++ setup.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 lorry-ssh-wrapper diff --git a/lorry b/lorry index b3e954c..509f0fb 100755 --- a/lorry +++ b/lorry @@ -431,8 +431,12 @@ class Lorry(cliapp.Application): def gitify_cvs(self, project_name, dirname, gitdir, spec): self.needs_aggressive = True - self.run_program(['git', 'cvsimport', '-a', '-d', spec['url'], - '-C', gitdir, spec['module']]) + env = dict(os.environ) + env['CVS_RSH'] = 'lorry-ssh-wrapper' + self.run_program( + ['git', 'cvsimport', '-a', '-d', spec['url'], + '-C', gitdir, spec['module']], + env=env) def gitify_hg(self, project_name, dirname, gitdir, spec): hgdir = os.path.join(dirname, 'hg') diff --git a/lorry-ssh-wrapper b/lorry-ssh-wrapper new file mode 100755 index 0000000..c4e2c1d --- /dev/null +++ b/lorry-ssh-wrapper @@ -0,0 +1,5 @@ +#!/bin/sh +# Run ssh without strict host key checking. + +set -eu +exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$@" diff --git a/setup.py b/setup.py index 811c727..cf172ea 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ FIXME author='Baserock', author_email='baserock-dev@baserock.org', url='http://wiki.baserock.org/', - scripts=['lorry', 'lorry.tar-importer'], + scripts=['lorry', 'lorry.tar-importer', 'lorry-ssh-wrapper'], data_files=[('share/man/man1', glob.glob('*.[1-8]'))], cmdclass={ 'build': GenerateManpage, -- cgit v1.2.1