Windows10 Ubuntu nextcloud 存储目录权限

为了方便文件管理,修改了data的默认路径到其他盘,但是打开网页提示:

Data directory (%s) is readable by other users,Please change the permissions to 0770 so that the directory cannot be listed by other users.

可以通过修改源码,禁用权限检查。

vim /var/www/nextcloud/lib/private/legacy/util.php

找到方法checkDataDirectoryPermissions
修改为:

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 (substr($perms, 2, 1) != '0') {
                $errors[] = array(
                    'error' => $l->t('Data directory (%s) is readable by other users', array($dataDirectory)),
                    'hint' => $permissionsModHint
                );
            }
        }
        return $errors;
    }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 14,602评论 5 6
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 12,878评论 0 6
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,160评论 19 139
  • 从开始放暑假至今,二嘎和他娘在这十几天的刀光剑影的交锋中,已经发展到了相互怀疑的阶段。 嘎娘觉得:小兔崽子...
    a宫雨阅读 1,144评论 0 1
  • 十二岁以前,我一直懵懂的活着,没心没肺地做着许多事情。笑和哭只为表达两种情绪,称作快乐和悲伤。身体是一根直线,大脑...
    Himmel_auf阅读 1,634评论 0 0

友情链接更多精彩内容