remote-file: add --remote-root option for security

This commit is contained in:
jean-emmanuel 2019-04-04 22:31:17 +02:00
parent e6394746e3
commit 03812933c5
4 changed files with 9 additions and 1 deletions

View file

@ -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)