From c79af592e6d4805a1c279f63629a6493654f9360 Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Fri, 18 Apr 2025 15:22:23 +0200 Subject: [PATCH] bugfix: properly escape exec command-strings --- com/isoterminal/ISOTerminal.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/com/isoterminal/ISOTerminal.js b/com/isoterminal/ISOTerminal.js index 90e0dfe..6b20e66 100644 --- a/com/isoterminal/ISOTerminal.js +++ b/com/isoterminal/ISOTerminal.js @@ -37,15 +37,12 @@ ISOTerminal.addEventListener = (event,cb) => { ISOTerminal.prototype.exec = function(opts){ const shellscript = opts[0]; const cb = opts[1]; + let cmd = `printf "\n\r"; { sh< /mnt/exec;\n` if( cb ){ window.cb = cb - this.send(`printf "\n\r"; ${shellscript} &> /mnt/exec; js ' - document.querySelector("[isoterminal]").emit("read_file", ["exec", window.cb ]) - '; - \n`,1) - }else{ - this.send(`printf "\n\r"; ${shellscript} \n`,1) + cmd += `js 'document.querySelector("[isoterminal]").emit("read_file", ["exec", window.cb ])';\n` } + this.send( cmd, 1 ) } ISOTerminal.prototype.hook = function(hookname,args){