mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-27 04:40:34 +03:00
luci: Fix file permissions for saved configs
This commit is contained in:
@@ -329,7 +329,8 @@ return baseclass.extend({
|
|||||||
aux: '',
|
aux: '',
|
||||||
rows: 10,
|
rows: 10,
|
||||||
callback: null,
|
callback: null,
|
||||||
file_exists: false
|
file_exists: false,
|
||||||
|
setperm: 644,
|
||||||
}, opts);
|
}, opts);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -390,6 +391,12 @@ return baseclass.extend({
|
|||||||
throw new Error('tee failed, rc = ' + res.code);
|
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 ]);
|
let res = await fs.exec('/bin/busybox', [ 'mv', '-f', tmpFile, fileName ]);
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
throw new Error('mv failed, rc = ' + res.code);
|
throw new Error('mv failed, rc = ' + res.code);
|
||||||
|
|||||||
Reference in New Issue
Block a user