Artifacts Associated With Ticket 3445787
Ticket change [0d7ee96408] (rid 114371) by apnadkarni on 2011-11-30 04:06:33:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tcl as of fossil head on 11/29/2011. Follow on to bug 3211758 which was fixed post 8.6b2 The fix in that bug made file a hidden command as was the case in older Tcl releases. However, the fix still does not allow all subcommands of file to be called even after exposing the file command. % interp create -safe interp0 % interp expose interp0 file % interp0 eval {file dirname c:/tcl} invalid command name "::tcl::file::dirname" Aside from whether this is a good idea or not, it is a backward compatibility issue as was the case with 3211758 - foundin initialized to: "obsolete: 8.6b2"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "apnadkarni"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "Exposed file command broken in safe interps"
- type initialized to: "Bug"
Ticket change [33c6e9d2f1] (rid 106650) by dgp on 2011-12-01 23:53:30:
- assignee changed to: "dgp"
- icomment:
I believe this is related to the old, difficult problem that [interp hide] and friends have never really been updated to work well with namespaces.
- login: "dgp"
- mimetype: "text/plain"
- subsystem changed to: "20. [interp]"
- username: "dgp"
Ticket change [2f62b265e9] (rid 93055) by johannes-kuhn on 2012-01-09 02:26:42:
- icomment:
The file command is now a namespace ensemble (see [namespace ensemble configure file]). All subcommands of file are now hidden with a name like tcl:file:atime. (Original name with all namespace seperators (::) replaced by a single colon(:)) This change does in fact break old scripts that uses [interp invokehidden $interp file]. The safe base uses the trused interp's file command, this is ok because the exposed command does not have any special treatment depending on the interp, unlike [file channels] witch displays all open channels that this interp has access to. This might probably only a small amout of scripts that actually 1) does not use the safe base and 2) use safe interps with (partialy) exposed file commands. My advise is: make [interp hide] namespace aware, and when a hidden namespace enseble is called (like [file]) it should _first_ check if the target command (e.g. [::tcl::file::atime]) is there and call that command. If there is no such hidden command it should check if there is an exposed command with that name. I think this is the only possible solution to have still backward compatibility and [file] a namespace ensemble
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"
- icomment:
Ticket change [9374a191dd] (rid 105819) by johannes-kuhn on 2012-01-09 02:54:03:
- icomment:
Ok, just saw that ::tcl::file::channels is never hidden, so scripts could easily create the [file] command it if they need it, but because the safe base defines an own [file] command, this is going to be a little bit more complex. Ohh, and by the way you broke my code... and it will take some of my time to fix it..
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"
- icomment:
Ticket change [612f3edb52] (rid 92202) by dkf on 2012-05-16 15:28:07:
- assignee changed to: "dkf"
- icomment:
This bug breaks tclhttpd. :-(
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dkf"
Ticket change [77a0745b58] (rid 89808) by johannes-kuhn on 2012-05-16 16:16:50:
- icomment:
Looks like there are more scripts and applications that actually uses [interp invokehidden file] than I thought. The problem why I don't rewrite my script to work with the newer Tcl 8.6 releases is that I expect that the names of the hidden commands will change again, this time with namespace, like tcl::file::atime, which would require to rewrite the script again. I still suggest allowing hidden commands with namespaces, and for backward compatibility, if the hidden command is a namespace ensemble ([file]) then invoke the resulting command ([tcl::file::atime]) hidden (if exist), if not, invoke it in the slave. This will not fix [interp expose file], but I don't know if exposing this command is a good idea.
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"
- icomment:
Ticket change [1cd0d2d258] (rid 90676) by dkf on 2012-05-16 21:16:08:
- closedate changed to: "2012-05-16T14:16:08"
- closer changed to: "dkf"
- icomment:
OK, made a lot more compatible with older code (the hidden subcommands now have visible replacements that generate error messages) and enhanced/shortened the Safe Tcl code for doing the exposing (with help from many 8.6 features). I *think* that fixes things, but it needs independent testing...
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "dkf"
Ticket change [993587fae1] (rid 133467) by dkf on 2013-08-22 09:43:44:
- closedate changed to: "2456526.90537574"
- comment changed to:
Tcl as of fossil head on 11/29/2011. Follow on to bug 3211758 which was fixed post 8.6b2 The fix in that bug made file a hidden command as was the case in older Tcl releases. However, the fix still does not allow all subcommands of file to be called even after exposing the file command. % interp create -safe interp0 % interp expose interp0 file % interp0 eval {file dirname c:/tcl} invalid command name "::tcl::file::dirname" Aside from whether this is a good idea or not, it is a backward compatibility issue as was the case with 3211758 - login: "dkf"
- mimetype: "text/plain"
- severity changed to: "Minor"
- status changed to: "Closed"