From 702fe4721db17990aa7306f59755dd70db488302 Mon Sep 17 00:00:00 2001 From: remittor Date: Sat, 17 Jan 2026 15:58:30 +0300 Subject: [PATCH] luci: Fix file permissions for saved configs --- .../htdocs/luci-static/resources/view/zapret/tools.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js index 9d585a0..0338dfa 100644 --- a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js +++ b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js @@ -329,7 +329,8 @@ return baseclass.extend({ aux: '', rows: 10, callback: null, - file_exists: false + file_exists: false, + setperm: 644, }, opts); }, @@ -390,6 +391,12 @@ return baseclass.extend({ throw new Error('tee failed, rc = ' + res.code); } } + if (this.setperm) { + let res = await fs.exec('/bin/busybox', [ 'chmod', '644', tmpFile ]); + if (res.code != 0) { + throw new Error('chmod failed, rc = ' + res.code); + } + } let res = await fs.exec('/bin/busybox', [ 'mv', '-f', tmpFile, fileName ]); if (res.code != 0) { throw new Error('mv failed, rc = ' + res.code);