From ebd1cfe2037b07a7519e23fdc8063beb68b4b313 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 8 Jan 2025 19:45:32 +0800 Subject: [PATCH] Update index.py --- plugins/rsyncd/index.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/rsyncd/index.py b/plugins/rsyncd/index.py index a2c48cbae..c1b88b438 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -730,9 +730,16 @@ def lsyncdAdd(): path = args['path'] if not mw.isAppleSystem(): - os.system("mkdir -p " + path + " &") - os.system("chown -R www:www " + path + " &") - os.system("chmod -R 755 " + path + " &") + if os.path.exists(path): + import utils.file as utils_file + info = utils_file.getAccess(path) + file_chown = info['chown'] + if file_chown != 'www': + return mw.returnJson(False, '建议手动执行命令: chown -R www:www '+ args_path) + else: + os.system("mkdir -p " + path + " &") + os.system("chown -R www:www " + path + " &") + os.system("chmod -R 755 " + path + " &") conn_type = args['conn_type']