[New-bugs-announce] [issue29135] run_proces logs the command without escaping parmaeters such that the coammns logged are not valid

William Gianopoulos report at bugs.python.org
Mon Jan 2 15:37:59 EST 2017


New submission from William Gianopoulos:

So, the arguments to run_process are not escaped when logged such that the logged command is un-parsable.
The following call:

self.run_process(['notify-send', '--app-name', 'Mozilla Build System', 'Mozilla Build System', msg])  where msg='Build complete'

ends up logging the following:

/usr/bin/notify-send --app-name Mozilla Build System Mozilla Build System Build complete

Where to be a valid command it needs to be:

/usr/bin/notify-send --app-name 'Mozilla Build System' 'Mozilla Build System' 'Build complete'


So, I think this needs to either not log the command at all or for each parameter replace any occurrence of the character "'" with "\'" and then enclose the entire parameter with "'" to make sure the logged command can actually be properly parsed.

----------
components: Library (Lib)
messages: 284498
nosy: wgianopoulos
priority: normal
severity: normal
status: open
title: run_proces logs the command without escaping parmaeters such that the coammns logged are not valid
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29135>
_______________________________________


More information about the New-bugs-announce mailing list