imgconverter: fix handling explicit file type

Fix handling source filename as 'type:path' - get parts, not try to
extract only the first one.

Related QubesOS/qubes-issues#3085
This commit is contained in:
Marek Marczykowski-Górecki 2017-12-22 03:49:44 +01:00
parent c57f28d8f7
commit 34e3c3acf3
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -250,9 +250,8 @@ get_from_stream(), get_from_vm(), get_xdg_icon_from_vm(), get_through_dvm()'''
'''Master end of image filter: writes untrusted image to stdout and
expects header+RGBA on stdin. This method is invoked from qvm-imgconverter-client.'''
filetype = None
if ':' in filename:
filetype, filename = filename.split(':', 1)[0]
filetype, filename = filename.split(':', 1)
sys.stdout.write('{0}:-\n'.format(filetype))
else:
sys.stdout.write('-\n')