美文网首页
Windows10 Ubuntu nextcloud 存储目录权

Windows10 Ubuntu nextcloud 存储目录权

作者: ettingshausen | 来源:发表于2017-03-22 09:19 被阅读2524次

    为了方便文件管理,修改了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;
        }
    

    相关文章

      网友评论

          本文标题:Windows10 Ubuntu nextcloud 存储目录权

          本文链接:https://www.haomeiwen.com/subject/jvgnnttx.html