Fixed issue 119, no environment for the shell_exec and exec calls.

For each call exec or shell_exec, I have added the ability to prepend a
string. For example '/usr/bin/env -i '.
This commit is contained in:
Loic d'Anterroches
2009-01-29 20:29:45 +01:00
parent 6724238616
commit 6153cd0b13
8 changed files with 20 additions and 5 deletions

View File

@@ -235,7 +235,8 @@ class IDF_Scm_Git
*/
public function getBlob($request_file_info, $dummy=null)
{
return shell_exec(sprintf('GIT_DIR=%s git cat-file blob %s',
return shell_exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'GIT_DIR=%s git cat-file blob %s',
escapeshellarg($this->repo),
escapeshellarg($request_file_info->hash)));
}
@@ -410,7 +411,8 @@ class IDF_Scm_Git
*/
public function getArchiveCommand($commit, $prefix='git-repo-dump/')
{
return sprintf('GIT_DIR=%s git archive --format=zip --prefix=%s %s',
return sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'GIT_DIR=%s git archive --format=zip --prefix=%s %s',
escapeshellarg($this->repo),
escapeshellarg($prefix),
escapeshellarg($commit));

View File

@@ -398,7 +398,8 @@ class IDF_Scm_Mercurial
*/
public function getArchiveCommand($commit, $prefix='')
{
return sprintf('hg archive --type=zip -R %s -r %s -',
return sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'hg archive --type=zip -R %s -r %s -',
escapeshellarg($this->repo),
escapeshellarg($commit));
}

View File

@@ -369,7 +369,7 @@ class IDF_Scm_Svn
*/
public function getArchiveCommand($commit, $prefix='git-repo-dump/')
{
throw new Exception(('Unsupported feature.'));
throw new Exception('Unsupported feature.');
}