From 227be5258ebb3bf2401c99d35aed640f72402c3e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 8 Jan 2025 15:01:48 +0800 Subject: [PATCH] up --- 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 a35c14a6a..a2c48cbae 100755 --- a/plugins/rsyncd/index.py +++ b/plugins/rsyncd/index.py @@ -387,9 +387,16 @@ def addRec(): args_ps = args['ps'] if not mw.isAppleSystem(): - os.system("mkdir -p " + args_path + " &") - os.system("chown -R www:www " + args_path + " &") - os.system("chmod -R 755 " + args_path + " &") + if os.path.exists(args_path): + import utils.file as utils_file + info = utils_file.getAccess(args_path) + file_chown = info['chown'] + if file_chown != 'www': + return mw.returnJson(False, '建议手动执行命令: chown -R www:www '+ args_path) + else: + os.system("mkdir -p " + args_path + " &") + os.system("chown -R www:www " + args_path + " &") + os.system("chmod -R 755 " + args_path + " &") delRecBy(args_name)