Skip to content
Tcl Source Code Artifact [7874fefd2a]
Login

Artifact [7874fefd2a]

Artifact 7874fefd2a0d3d4613c817d03002c8d76c3f5e7b:

Ticket change [7874fefd2a] - New ticket [432499ffffffffff|432499ffff] <i>command string passed to exec not quoted</i>. by kenpoole on 2001-06-12 18:47:30.
D 2001-06-12T18:47:30
J assignee nobody
J cmimetype text/plain
J comment If\sI\spass\sthe\sfully\squalified\spath\sto\san\sexecutable\sthat\shas\sspaces\sin\sits\spath\sto\sthe\sexec\scommand,\sit\swill\sexecute\sproperly.\s\sIf\sI\spass\sjust\sthe\scommand\sname,\sit\swill\serror\sout\swith\s"invalid\sargument"\sas\sthe\serror\smessage.\s\s\n\nIf\sI\smodify\sthe\ssource\sin\stclWinPipe.c\s(starting\sat\sline\s1525\sfrom\sthe\spackaged\s8.3.3\star\sball)\sas\sfollows:\n\n#define\sKEP_EXEC_PROBLEM\n#ifdef\sKEP_EXEC_PROBLEM\nif\s(arg[0]\s==\s'\\0')\s{\n#else\nif\s(argv[i][0]\s==\s'\\0')\s{\n#endif\n\s\s\s\squote\s=\s1;\n}\selse\s{\n#ifdef\sKEP_EXEC_PROBLEM\n\s\s\s\sfor\s(start\s=\sarg;\s*start\s!=\s'\\0';\sstart++)\s{\n#else\n\s\s\s\sfor\s(start\s=\sargv[i];\s*start\s!=\s'\\0';\sstart++)\s{\n#endif\n\nthe\sexec\sworks\sas\sI\sexpect.\s\sThe\ssecond\sset\sof\schanges\sis\swhat\sactually\sfixes\smy\sproblem\s(start=arg).\s\sIf\sthe\sfully\squalified\spath\sis\sspecified,\sthe\sargv[0]\sand\sarg\scontain\sidentical\sstrings.\s\sif\sinvoked\sas:\nexec\sapplication\nthe\svar\sargv[0]\swill\scontain\s"application",\sarg\swill\scontain\sthe\sfully\squalified\spath\s(ie\sc:\\Program\sFiles\\appdir\\application.exe).\s\sSince\sthe\scode\sthat\schecks\sfor\s"quoting"\swas\slooking\sat\sargv[0],\sit\swasnt\sseeing\sthe\s"space"\sin\sthe\sfully\squalified\spath\sand\sthe\scommand\sto\sactually\slaunch\sthe\sapp\swould\sfail.\n
J foundin obsolete:\s8.3.3
J priority 5\sMedium
J resolution None
J status Open
J submitter kenpoole
J subsystem 16.\sCommands\sA-H
J title command\sstring\spassed\sto\sexec\snot\squoted
J type Bug
K 432499ffffffffffffffffffffffffffffffffff
U kenpoole
Z 37135ba8c73f6a39dbb2664a1e74c491