#962: Fix bug when OGAgent processes script lines; now it's not necessary to use escape characters in script input box.

oglive
Ramón M. Gómez 2020-03-05 08:14:28 +01:00
parent e3878fd47c
commit 8d2fe2f538
1 changed files with 2 additions and 2 deletions

View File

@ -282,8 +282,8 @@ class OpenGnSysWorker(ServerWorker):
logger.debug('Processing script request')
# Decoding script
script = urllib.unquote(post_params.get('script').decode('base64')).decode('utf8')
script = 'import subprocess;' +\
';'.join(['subprocess.check_output({},shell=True)'.format(c) for c in script.split('\n')])
script = 'import subprocess;{0}'.format(
';'.join(['subprocess.check_output({0},shell=True)'.format(repr(c)) for c in script.split('\n')]))
# Executing script.
if post_params.get('client', 'false') == 'false':
thr = ScriptExecutorThread(script)