|
@@ 938-943 (lines=6) @@
|
| 935 |
|
chmod($dataDirectory, 0770); |
| 936 |
|
clearstatcache(); |
| 937 |
|
$perms = substr(decoct(@fileperms($dataDirectory)), -3); |
| 938 |
|
if (substr($perms, 2, 1) != '0') { |
| 939 |
|
$errors[] = array( |
| 940 |
|
'error' => $l->t('Data directory (%s) is readable by other users', array($dataDirectory)), |
| 941 |
|
'hint' => $permissionsModHint |
| 942 |
|
); |
| 943 |
|
} |
| 944 |
|
} |
| 945 |
|
return $errors; |
| 946 |
|
} |
|
@@ 958-963 (lines=6) @@
|
| 955 |
|
public static function checkDataDirectoryValidity($dataDirectory) { |
| 956 |
|
$l = \OC::$server->getL10N('lib'); |
| 957 |
|
$errors = []; |
| 958 |
|
if ($dataDirectory[0] !== '/') { |
| 959 |
|
$errors[] = [ |
| 960 |
|
'error' => $l->t('Data directory (%s) must be an absolute path', [$dataDirectory]), |
| 961 |
|
'hint' => $l->t('Check the value of "datadirectory" in your configuration') |
| 962 |
|
]; |
| 963 |
|
} |
| 964 |
|
if (!file_exists($dataDirectory . '/.ocdata')) { |
| 965 |
|
$errors[] = [ |
| 966 |
|
'error' => $l->t('Data directory (%s) is invalid', [$dataDirectory]), |
|
@@ 964-970 (lines=7) @@
|
| 961 |
|
'hint' => $l->t('Check the value of "datadirectory" in your configuration') |
| 962 |
|
]; |
| 963 |
|
} |
| 964 |
|
if (!file_exists($dataDirectory . '/.ocdata')) { |
| 965 |
|
$errors[] = [ |
| 966 |
|
'error' => $l->t('Data directory (%s) is invalid', [$dataDirectory]), |
| 967 |
|
'hint' => $l->t('Please check that the data directory contains a file' . |
| 968 |
|
' ".ocdata" in its root.') |
| 969 |
|
]; |
| 970 |
|
} |
| 971 |
|
return $errors; |
| 972 |
|
} |
| 973 |
|
|