Bug 4954 - tl-run-winapp/tl-run-winapp-seamless mishandles arguments with spaces
Summary: tl-run-winapp/tl-run-winapp-seamless mishandles arguments with spaces
Status: CLOSED WONTFIX
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: | WTS Tools (deprecated) (show other bugs)
Version: pre-1.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.2.0
Assignee: Henrik Andersson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-08 17:45 CET by Karl Mikaelsson
Modified: 2014-09-23 13:10 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2014-01-08 17:45:58 CET
Both applications build a command line to be run on the Windows server, and does so from a argument vector given to it. This command line looks to be space-separated, but arguments containing spaces are not quoted properly.

Consider that we create a shortcut that tries to open a H:\Documents\a very special file.pdf. Even though we'd escape the spaces according to all rules on the Linux side, it wouldn't help - we'll get a command string looking like this, which Windows and/or applications won't be able to work with.

  cmd /c start "" "AcroRd32.exe" H:\Documents\a very special file.pdf

Adding quotes around each of the extra arguments solves the immediate problem but this could prove to have other consequences - perhaps some extra logic is required here.

  cmd /c start "" "AcroRd32.exe" "H:\Documents\a very special file.pdf"
Comment 2 Karl Mikaelsson cendio 2014-01-09 10:51:41 CET
This is sadly impossible, because of how Windows works. Applications on Windows are started with a command line string that each application is free to interpret in any way it likes.

Notepad, for instance, considers the string File Name.txt to be a file called File Name.txt, while Word would require you to express its name as "File Name.txt". This means that it's impossible to come up with a solution in tl-run-winapp{,-seamless} that would work with all applications.

Note You need to log in before you can comment on or make changes to this bug.