Skip to content
Snippets Groups Projects
Commit a7798786 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #10022 from owncloud/fix-exec-admin-master

only call exec() if allowed to
parents 9bcf2c35 673a8bb2
Branches
No related tags found
No related merge requests found
......@@ -101,9 +101,11 @@ $tmpl->printPage();
* @return null|string
*/
function findBinaryPath($program) {
if (OC_Helper::is_function_enabled('exec')) {
exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
if ($returnCode === 0 && count($output) > 0) {
return escapeshellcmd($output[0]);
}
}
return null;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment