Overview
| Artifact ID: | 7874fefd2a0d3d4613c817d03002c8d76c3f5e7b |
|---|---|
| Ticket: | 432499ffffffffffffffffffffffffffffffffff
command string passed to exec not quoted |
| User & Date: | kenpoole on 2001-06-12 18:47:30 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
If I pass the fully qualified path to an executable that has spaces in its path to the exec command, it will execute properly. If I pass just the command name, it will error out with "invalid argument" as the error message. If I modify the source in tclWinPipe.c (starting at line 1525 from the packaged 8.3.3 tar ball) as follows: #define KEP_EXEC_PROBLEM #ifdef KEP_EXEC_PROBLEM if (arg[0] == '\0') { #else if (argv[i][0] == '\0') { #endif quote = 1; } else { #ifdef KEP_EXEC_PROBLEM for (start = arg; *start != '\0'; start++) { #else for (start = argv[i]; *start != '\0'; start++) { #endif the exec works as I expect. The second set of changes is what actually fixes my problem (start=arg). If the fully qualified path is specified, the argv[0] and arg contain identical strings. if invoked as: exec application the var argv[0] will contain "application", arg will contain the fully qualified path (ie c:\Program Files\appdir\application.exe). Since the code that checks for "quoting" was looking at argv[0], it wasnt seeing the "space" in the fully qualified path and the command to actually launch the app would fail. - foundin changed to: "obsolete: 8.3.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "kenpoole"
- subsystem changed to: "16. Commands A-H"
- title changed to: "command string passed to exec not quoted"
- type changed to: "Bug"