remote-file: add --remote-root option for security
This commit is contained in:
parent
09d41cae5b
commit
2ab2614853
4 changed files with 9 additions and 1 deletions
|
|
@ -380,6 +380,9 @@ module.exports = {
|
|||
|
||||
if (data.path) p = path.resolve(...data.path)
|
||||
|
||||
var root = settings.read('remoteRoot')
|
||||
if (root && !p.includes(root)) p = root
|
||||
|
||||
fs.readdir(p, (err, files)=>{
|
||||
if (err) {
|
||||
ipc.send('notify', {class: 'error', message: err.message}, clientId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue