From e5731b6e1a74fb4518b351e7770202ab9a297892 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Fri, 6 Feb 2015 14:18:36 +0100
Subject: [PATCH] Use better way to check for the existence of smbclient

---
 apps/files_external/lib/smb.php | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 571a265e98..34f91defdc 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -267,12 +267,7 @@ class SMB extends Common {
 	 * 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');
 	}
 }
-- 
GitLab