mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-27 12:50:35 +03:00
luci: Fix file permissions for saved configs
This commit is contained in:
@@ -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', '' + this.setperm, 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);
|
||||
|
||||
Reference in New Issue
Block a user