]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use better way to check for the existence of smbclient
authorRobin Appelman <icewind@owncloud.com>
Fri, 6 Feb 2015 13:18:36 +0000 (14:18 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 16 Feb 2015 12:52:11 +0000 (13:52 +0100)
apps/files_external/lib/smb.php

index 571a265e983c5836b09f4d02360fbca263799888..34f91defdccbceddd125819e643b7253c6e8f6d7 100644 (file)
@@ -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');
        }
 }