From 0274dcba575272585a6f0b16bc777301f9458537 Mon Sep 17 00:00:00 2001
From: Joas Schilling <nickvergessen@gmx.de>
Date: Tue, 25 Nov 2014 11:06:26 +0100
Subject: [PATCH] Replace some more "command -v" calls with the Helper method

---
 apps/files_external/lib/smb.php | 9 ++-------
 lib/private/installer.php       | 4 ++--
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 6e53c4a993..3f0b0f45bf 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -139,13 +139,8 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
 	 * check if smbclient is installed
 	 */
 	public static function checkDependencies() {
-		if (function_exists('shell_exec')) {
-			$output=shell_exec('command -v smbclient 2> /dev/null');
-			if (!empty($output)) {
-				return true;
-			}
-		}
-		return array('smbclient');
+		$smbClientExists = (bool) \OC_Helper::findBinaryPath('smbclient');
+		return $smbClientExists ? true : array('smbclient');
 	}
 
 }
diff --git a/lib/private/installer.php b/lib/private/installer.php
index cd1d8ce392..f43969691c 100644
--- a/lib/private/installer.php
+++ b/lib/private/installer.php
@@ -558,8 +558,8 @@ class OC_Installer{
 		// is the code checker enabled?
 		if(OC_Config::getValue('appcodechecker', true)) {
 			// check if grep is installed
-			$grep = exec('command -v grep');
-			if($grep=='') {
+			$grep = \OC_Helper::findBinaryPath('grep');
+			if (!$grep) {
 				OC_Log::write('core',
 					'grep not installed. So checking the code of the app "'.$appname.'" was not possible',
 					OC_Log::ERROR);
-- 
GitLab