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

@@ -191,7 +191,8 @@ class IDF_Plugin_SyncGit_Serve
public function initRepository($fullpath)
{
mkdir($fullpath, 0750, true);
exec(sprintf('git --git-dir=%s init', escapeshellarg($fullpath)),
exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'git --git-dir=%s init', escapeshellarg($fullpath)),
$out, $res);
if ($res != 0) {
throw new Exception(sprintf('Init repository error, exit status %d.', $res));

View File

@@ -79,6 +79,7 @@ class IDF_Plugin_SyncMercurial
$output = array();
$cmd = sprintf('hg init %s',
escapeshellarg($mercurial_path.'/'.$shortname));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$ll = exec($cmd, $output, $return);
return ($return == 0);
}

View File

@@ -79,6 +79,7 @@ class IDF_Plugin_SyncSvn
$output = array();
$cmd = sprintf('svnadmin create %s',
escapeshellarg($svn_path.'/'.$shortname));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$ll = exec($cmd, $output, $return);
return ($return == 0);
}