Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7874fefd2a0d3d4613c817d03002c8d76c3f5e7b
Ticket: 432499ffffffffffffffffffffffffffffffffff
command string passed to exec not quoted
User & Date: kenpoole on 2001-06-12 18:47:30
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. 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.
    
    
  4. foundin changed to: "obsolete: 8.3.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "kenpoole"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to: "command string passed to exec not quoted"
  11. type changed to: "Bug"