Overview
| Artifact ID: | ebaccf28475f601280050ad91d4bebc0a0128ab6ddda67c5b7e2f739314d0d1e |
|---|---|
| Ticket: | fb2fa9b3f6467ee66f543ec904e37aa8508f2fb1
exec broken for command having windows environment variables |
| User & Date: | juliannoble2 on 2023-10-26 11:41:11 |
Changes
- icomment:
For this particular case I would use exec cmd /v /c echo !SystemRoot! (which raises the question in my mind of why % is even treated differently) I'd also note that % is a legitimate character in the NTFS filesystem - so this sort of magic quoting of % can interfere in other places :/ I am strongly of the opinion that all this sort of quoting in exec/open is a mistake. I appreciate the effort made in analysing https://core.tcl-lang.org/tcl/info/21b0629c81 as a 'vulnerability' but I disagree. It's at best an argument for a new higher level function or wrapper over exec. I'm sorry I missed the chance to rail against this change when it happened. If Tcl is to function as a glue language we need the primitives to shoot ourselves in the foot and pass things verbatim to the underlying commands as much as possible. We respect that Tcl commands have the freedom to interpret their arguments as they wish - we should respect that commandlines can be interpreted as they wish - including as to how they do or don't separate arguments. That's somewhat at odds with providing a neat interface that one can safely throw arguments at - but the current situation makes reasoning about what is going on so much harder and cripples Tcl. Exec/Open already had some oddities before this - so they weren't perfect - but this makes the situation that much worse.
- login: "juliannoble2"
- mimetype: "text/plain"