2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 22:35:35 +00:00

less shell ;-)

Using a list as parameter for subprocess.call is more secure, and avoids
funny problems if the filename to display contains spaces or other funny
characters.
This commit is contained in:
Christian Boltz
2020-05-07 19:45:39 +02:00
parent 74c90c797c
commit 48bae9e3b0

View File

@@ -299,7 +299,7 @@ def UI_ShowFile(header, filename):
write_json(jsonout)
json_response('changes')["response"] # wait for response to delay deletion of filename (and ignore response content)
else:
subprocess.call('less %s' % filename, shell=True)
subprocess.call(['less', filename])
CMDS = {'CMD_ALLOW': _('(A)llow'),