flucont / btcloud

PHP开发的宝塔面板第三方云端

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sorry, deny open panel

2331892928 opened this issue · comments

commented

在使用计划任务进行下载插件以及在网页下载插件时,有时候会出现
sorry, deny open panel错误,网站目录权限已设置为777。扩展已安装fileinfo。
php版本7.4,哪里的问题
错误日志为:
code: 1
file: "/www/wwwroot/bt.ymypay.cn/app/lib/Plugins.php"
line: 258
message: "sorry, deny open panel"
name: "think\exception\ErrorException"
source:
[
" $data = str_replace('\'https://www.bt.cn/api/panel/notpro', 'public.GetConfigValue(\'home\')+\'/api/panel/notpro', $data);\r\n",
"\r\n",
" $data = str_replace('\'http://www.bt.cn/api/wpanel/get_soft_list_test', 'public.GetConfigValue(\'home\')+\'/api/wpanel/get_soft_list_test', $data);\r\n",
" $data = str_replace('\'https://www.bt.cn/api/wpanel/get_soft_list_test', 'public.GetConfigValue(\'home\')+\'/api/wpanel/get_soft_list_test', $data);\r\n",
" $data = str_replace('\'http://www.bt.cn/api/wpanel/get_soft_list', 'public.GetConfigValue(\'home\')+\'/api/wpanel/get_soft_list', $data);\r\n",
" $data = str_replace('\'https://www.bt.cn/api/wpanel/get_soft_list', 'public.GetConfigValue(\'home\')+\'/api/wpanel/get_soft_list', $data);\r\n",
" $data = str_replace('\'http://www.bt.cn/api/wpanel/notpro', 'public.GetConfigValue(\'home\')+\'/api/wpanel/notpro', $data);\r\n",
" $data = str_replace('\'https://www.bt.cn/api/wpanel/notpro', 'public.GetConfigValue(\'home\')+\'/api/wpanel/notpro', $data);\r\n",
"\r\n",
" file_put_contents($main_filepath, $data);\r\n",
" }\r\n",
"\r\n",
" //下载插件其他文件\r\n",
" public static function download_plugin_other($fname, $filemd5 = null, $os = 'Linux'){\r\n",
" $filepath = get_data_dir().'plugins/other/'.$fname;\r\n",
" @mkdir(dirname($filepath), 0777, true);\r\n",
" $btapi = self::get_btapi($os);\r\n",
" $result = $btapi->get_plugin_other_filename($fname);\r\n",
" if($result && isset($result['status'])){\r\n"
]

trace:
[
{
"function": "appShutdown",
"class": "think\initializer\Error",
"type": "->"
}
]

commented

似乎是到 file_put_contents($main_filepath, $data);这步出的错,但我权限给的是777,怎么会出错呢?面板是宝塔

commented

虽然是那步报的错,但我看被修改的文件是成功修改了的,修改日期都变了

commented

用try包裹还捕获不了这个错误,说明这个语句没有问题,但thinkphp就说这句话有错误,我把$data替换为"1",不仅写入成功,也不报错。如果为$data那么不仅写入成功,还报错,求解决。说明$data里的东西有问题,我把str_replace这些屏蔽了仍然错误,说明有些插件的.py文件有问题,就是成功读取.py的内容,然后替换成功,仍然报错

commented

几乎所有付费插件都有这个问题,因为都要走这个替换授权函数

commented

比如oos-1.6,大家看一下

我这边没出现这种问题,不只是权限,可以看看文件所属用户是不是对的。以及是不是安装了什么安全软件,写入拦截了。