puppetlabs / puppetlabs-vcsrepo

Support for source control repositories
http://forge.puppetlabs.com/puppetlabs/vcsrepo
GNU General Public License v2.0
223 stars 284 forks source link

Allow specifying tmpdir for git wrapper script #612

Closed nabertrand closed 1 year ago

nabertrand commented 1 year ago

On systems with a git version too old to support the GIT_SSH_COMMAND, a git wrapper script is created in the default temp directory. If that filesystem is mounted noexec, git is unable to execute the wrapper script:

Error: Execution of 'git clone git@github.com:org/repo.git /repo_dir' returned 128: Cloning into '/repo_dir'...
fatal: cannot exec '/tmp/git-helper20230607-525-1fvzyp1': Permission denied

This was solved in https://github.com/puppetlabs/puppetlabs-vcsrepo/commit/7f97a76f4682a7c1d5bfbbc3cd5a6dd9523b1d96 by using the Puppet statedir instead of the default temp directory, but this was later reverted in https://github.com/puppetlabs/puppetlabs-vcsrepo/commit/684200247c33e42f095f9478033b1d2a50bbbab0.

This PR enables specifying the directory used for the wrapper script.