Artifacts Associated With Ticket 2964715fffffffff
Ticket change [d54064962d] (rid 123590) by kjnash on 2010-03-06 13:29:05:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Version core-8-5-branch v 1.16.4.6 Using ActiveTcl 8.5.8.1 The command ::safe::AliasGlob has several problems. - [glob *] reveals the contents of [pwd]. - The call from ::tcl::tm::UnknownHandler (to search ::tcl::tm module directories) fails. - Its test for calls from tclPkgUnknown is ineffective. - Its error messages are unhelpful. A patch to the core-8-5-branch v 1.16.4.6 is attached. # Description of alterations to ::safe::AliasGlob from core-8-5-branch v 1.16.4.6 # # (1) - add a comment header # (2) - change test for "pkgIndex.tcl" and move it so that it is effective # (3) - give a meaningful error message if pkgIndex.tcl is detected # (4) - give a meaningful error message if -directory is used twice # (5) - supply a value for dir in cmd # (6) - require option -directory # - This is a change to the (undocumented) behaviour of the exposed glob # command. # - The change is compatible with the required use cases for tm.tcl and # (if the pkgIndex.tcl test is removed in future) package.tcl. # - It is a good fit to the Safe Base idea that operations are permitted # only in certain directories. Closed Bug 2906841 is related.
- foundin initialized to: "obsolete: 8.5.8"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "kjnash"
- subsystem initialized to: "33. Safe Base"
- title initialized to: "Problems with Safe Base exposed glob command"
- type initialized to: "Bug"
Ticket change [0316abcb30] (rid 119759) by kjnash on 2010-03-06 20:29:06:
- icomment:
File Added - 365637: safe.tcl.patch
- login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Add attachment "safe.tcl.patch" [3c20baa49e] (rid 120868) by kjnash on 2010-03-06 20:29:06.
Ticket change [1ae4c140cd] (rid 123052) by dkf on 2010-03-06 21:10:22:
- assignee changed to: "dkf"
- icomment:
I've been rewriting quite a bit of AliasGlob for 8.6, so I'll take over control of it and have a proper look. (If you can, testing whether the problems you've observed with 8.5.8 also occur with the CVS HEAD - a recent 8.6b1.1 will do - then that would make my life easier. Thanks, and I understand if that's not practical.)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [81fc324afe] (rid 117142) by kjnash on 2010-03-06 22:49:08:
- icomment:
I've built 8.6 from CVS, and it has similar problems, plus some more of its own. It has replaced 8.5's if {[catch { ::interp invokehidden $slave glob {*}$cmd } msg]} { Log $slave $msg return -code error "script error" } with try { ::interp invokehidden $slave glob {*}$cmd } on error msg { Log $slave $msg return -code error "script error" } and so the result of the glob is thrown away if there is no error. Why not stick with the [catch] formulation? As well as being familiar, it will not be necessary (yet) to maintain separate versions of safe.tcl for 8.5 and 8.6. - login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Ticket change [1734634f51] (rid 122448) by johannes-kuhn on 2010-03-10 01:15:18:
- icomment:
See also http://sourceforge.net/tracker/?func=detail&aid=2906841&group_id=10894&atid=110894
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"
- icomment:
Ticket change [c0e392d7a5] (rid 102493) by kjnash on 2010-03-10 23:38:16:
- icomment:
File Added - 366147: safe.tcl.patch2
- login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Add attachment "safe.tcl.patch2" [4175752862] (rid 116197) by kjnash on 2010-03-10 23:38:16.
Add attachment "safe.tcl.patch3" [4e6363795d] (rid 127223) by kjnash on 2010-03-10 23:38:38.
Ticket change [6a56c99607] (rid 128131) by kjnash on 2010-03-10 23:38:38:
- icomment:
File Added - 366148: safe.tcl.patch3
- login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Ticket change [ef2b5b1df3] (rid 108946) by kjnash on 2010-03-10 23:38:58:
- icomment:
File Added - 366149: safe.tcl.patch1-3
- login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Add attachment "safe.tcl.patch1-3" [51ccde35d0] (rid 126190) by kjnash on 2010-03-10 23:38:58.
Ticket change [938d21fa54] (rid 105838) by kjnash on 2010-03-10 23:39:22:
- icomment:
File Added - 366150: safe-extras.test
- login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Add attachment "safe-extras.test" [b64e3b07dd] (rid 125396) by kjnash on 2010-03-10 23:39:22.
Ticket change [69730d5023] (rid 103253) by kjnash on 2010-03-10 23:42:54:
- icomment:
More bugs (B) in ::safe::InterpSetConfig - when the safe interpreter is given the same module path as the master, the path order is reversed, and subdirectories are added not only to the access path but also unnecessarily to the module path. safe.tcl.patch2 is a patch against {core-8-5-branch v 1.16.4.6 patched by safe.tcl.patch} that fixes bugs (B). More bugs (C) in ::safe::AliasGlob - (C1) glob's option -nocomplain protects against error return if there are no matches; it should not protect against errors in arguments, e.g. no pattern (C2) -join (if present) need not be the last non-pattern argument (C3) AliasGlob tests that the directory part of a (compounded) glob pattern belongs to the access path; the test fails if the directory has a glob wildcard. safe.tcl.patch3 is a patch against {core-8-5-branch v 1.16.4.6 patched by safe.tcl.patch, safe.tcl.patch2} that fixes bugs (C). safe.tcl.patch1-3 is a cumulative patch against core-8-5-branch v 1.16.4.6 that fixes all bugs mentioned so far in 2964715. safe-extras.test has tests intended for safe.test. Tests 12.* are modified from safe.test for the patches provided here (notably altered error messages). Tests 13.*, 14.* deal with bugs (C) and (B) respectively. - login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Ticket change [41baae1947] (rid 116240) by johannes-kuhn on 2010-05-20 00:12:11:
- icomment:
Glob on safe base currently broken, see bug #3004191. With the patch from #3004191 glob * still returns the contents of [pwd] Greetings.
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"
- icomment:
Ticket change [ad68ee9ab7] (rid 101465) by dkf on 2012-05-17 21:48:41:
- closedate changed to: "2012-05-17T14:48:41"
- closer changed to: "dkf"
- icomment:
OK, I think that all fixes it. The tests were *particularly* valuable. Left at Pending in case I've missed something. (Globbing is complicated, and the amount of it we want to allow in safe interpreters is strictly limited — just enough to allow finding packages, no more. This makes the aliased-glob we use a very tricky piece of Tcl code indeed.)
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "dkf"
Ticket change [96aa9aed7c] (rid 106363) by johannes-kuhn on 2012-05-17 23:30:26:
- icomment:
An alternative to provide a save subset of glob is to search for tm packages in the parent. This approach would solve the huge glob mess, and it allows that the safe base uses it's original security policy, so it would be not longer necessary to allow the access to files in subdirs of the tokens (like tm does when requesting [package require tcl::chan::fifo]) I know recreating the tm for the safe base can be much work, but it might be worth the work.
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"
- icomment:
Ticket change [ab09255e33] (rid 101028) by kjnash on 2012-06-04 02:50:28:
- icomment:
1. Bug in AliasGlob: it does "-join" itself, and so it does not need to pass "-join" to the glob command Further bugs in safe.tcl - 2. Spurious directories in module path (test failure safe-14.1) 3. Does not clean up correctly after deleting a slave that has Safe Base sub-interpreters 4. init.tcl inappropriately adds un-tokenized directories to a safe slave's auto_path A patch that fixes these bugs, and provides suitable tests, is provided on feature request 2964719.
- login: "kjnash"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "kjnash"
- icomment:
Ticket change [fdda9ffe3f] (rid 139912) by dkf on 2014-09-14 16:39:52:
- closer changed to: "nobody"
- comment changed to:
Version core-8-5-branch v 1.16.4.6 Using ActiveTcl 8.5.8.1 The command ::safe::AliasGlob has several problems. - [glob *] reveals the contents of [pwd]. - The call from ::tcl::tm::UnknownHandler (to search ::tcl::tm module directories) fails. - Its test for calls from tclPkgUnknown is ineffective. - Its error messages are unhelpful. A patch to the core-8-5-branch v 1.16.4.6 is attached. # Description of alterations to ::safe::AliasGlob from core-8-5-branch v 1.16.4.6 # # (1) - add a comment header # (2) - change test for "pkgIndex.tcl" and move it so that it is effective # (3) - give a meaningful error message if pkgIndex.tcl is detected # (4) - give a meaningful error message if -directory is used twice # (5) - supply a value for dir in cmd # (6) - require option -directory # - This is a change to the (undocumented) behaviour of the exposed glob # command. # - The change is compatible with the required use cases for tm.tcl and # (if the pkgIndex.tcl test is removed in future) package.tcl. # - It is a good fit to the Safe Base idea that operations are permitted # only in certain directories. Closed Bug 2906841 is related.
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "6"
- severity changed to: "Minor"
Ticket change [4749882f70] (rid 185054) by kjnash on 2020-07-21 00:45:30:
- closedate changed to: "2459051.53159951"
- closer changed to: "kjnash"
- icomment:
Most of these fixes were applied. Any issues mentioned here but unresolved are discussed in bug reports submitted in July 2020.
- login: "kjnash"
- mimetype: "text/plain"
- status changed to: "Closed"