From c2d88a08b796ca19c8b5ec63bfd34ac32ead4208 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 8 Jul 2016 15:55:17 +0200 Subject: Remove unneeded checks if it runs on a Windows machine * the setup check is still there --- lib/private/legacy/helper.php | 2 +- lib/private/legacy/util.php | 33 ++++++++++++--------------------- 2 files changed, 13 insertions(+), 22 deletions(-) (limited to 'lib/private/legacy') diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php index 21fb3cbc5ab..06cffe80837 100644 --- a/lib/private/legacy/helper.php +++ b/lib/private/legacy/helper.php @@ -534,7 +534,7 @@ class OC_Helper { return $memcache->get($program); } $result = null; - if (!\OC_Util::runningOnWindows() && self::is_function_enabled('exec')) { + if (self::is_function_enabled('exec')) { $exeSniffer = new ExecutableFinder(); // Returns null if nothing is found $result = $exeSniffer->find($program); diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 3c56008a48b..2a876eda4d0 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -902,22 +902,18 @@ class OC_Util { public static function checkDataDirectoryPermissions($dataDirectory) { $l = \OC::$server->getL10N('lib'); $errors = array(); - if (self::runningOnWindows()) { - //TODO: permissions checks for windows hosts - } else { - $permissionsModHint = $l->t('Please change the permissions to 0770 so that the directory' - . ' cannot be listed by other users.'); + $permissionsModHint = $l->t('Please change the permissions to 0770 so that the directory' + . ' cannot be listed by other users.'); + $perms = substr(decoct(@fileperms($dataDirectory)), -3); + if (substr($perms, -1) != '0') { + chmod($dataDirectory, 0770); + clearstatcache(); $perms = substr(decoct(@fileperms($dataDirectory)), -3); - if (substr($perms, -1) != '0') { - chmod($dataDirectory, 0770); - clearstatcache(); - $perms = substr(decoct(@fileperms($dataDirectory)), -3); - if (substr($perms, 2, 1) != '0') { - $errors[] = array( - 'error' => $l->t('Data directory (%s) is readable by other users', array($dataDirectory)), - 'hint' => $permissionsModHint - ); - } + if (substr($perms, 2, 1) != '0') { + $errors[] = array( + 'error' => $l->t('Data directory (%s) is readable by other users', array($dataDirectory)), + 'hint' => $permissionsModHint + ); } } return $errors; @@ -933,7 +929,7 @@ class OC_Util { public static function checkDataDirectoryValidity($dataDirectory) { $l = \OC::$server->getL10N('lib'); $errors = []; - if (!self::runningOnWindows() && $dataDirectory[0] !== '/') { + if ($dataDirectory[0] !== '/') { $errors[] = [ 'error' => $l->t('Data directory (%s) must be an absolute path', [$dataDirectory]), 'hint' => $l->t('Check the value of "datadirectory" in your configuration') @@ -1203,11 +1199,6 @@ class OC_Util { * @return bool */ public static function isSetLocaleWorking() { - // setlocale test is pointless on Windows - if (OC_Util::runningOnWindows()) { - return true; - } - \Patchwork\Utf8\Bootup::initLocale(); if ('' === basename('ยง')) { return false; -- cgit v1.2.3