tflidd
June 10, 2017, 9:35pm
2
Yes, I think it is set automatically to 770:
* @param string $dataDirectory
* @return array arrays with error messages and hints
*/
public static function checkDataDirectoryPermissions($dataDirectory) {
$l = \OC::$server->getL10N('lib');
$errors = array();
$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 ($perms[2] !== '0') {
$errors[] = [
'error' => $l->t('Your data directory is readable by other users'),
'hint' => $permissionsModHint
];
}
}
return $errors;
If you want to grant access for other users, it’s perhaps better to set the group permissions that this user can access it (depending on your setup, a chmod 750 would be better, e.g. if you use it for a backup process).
1 Like