Artifacts Associated With Ticket 2906841
Ticket change [93aefb78a1] (rid 105858) by john13a on 2009-12-01 14:21:40:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
8.5.7 - Windows % safe::interpCreate test test % test eval glob ../* {../All Users} ../Johannes 8.6b1.1 - Windows % safe::interpCreate test test % test eval glob ../* can't read "msg": no such variable % set errorInfo can't read "msg": no such variable while executing "Log $slave "GLOB @ $msg" NOTICE" (procedure "::safe::AliasGlob" line 65) invoked from within "glob ../*" invoked from within "test eval glob ../*" Some results from others <dkf> $ tclsh8.5 <dkf> % safe::interpCreate test <dkf> test <dkf> % test eval glob ../* <dkf> invalid command name "glob" <emiliano> emiliano@merlot:~$ tclsh8.6 <emiliano> % safe::interpCreate test <emiliano> test <emiliano> % test eval glob ../* <emiliano> ../ftp ../emiliano <emiliano> HEAD (two or three days ago), linux - foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "john13a"
- subsystem initialized to: "33. Safe Base"
- title initialized to:
calling [glob ../*] in an safe interp returns wired things
- type initialized to: "Bug"
Add attachment "safe.tcl" [99bcd151d4] (rid 110843) by john13a on 2009-12-01 21:21:40.
Ticket change [3f86b678de] (rid 121472) by john13a on 2009-12-01 21:21:40:
- icomment:
File Added - 353416: safe.tcl
- login: "john13a"
- mimetype: "text/plain"
- username: "john13a"
- icomment:
Ticket change [a14519581a] (rid 109689) by andreas_kupries on 2009-12-02 00:00:21:
- icomment:
I believe that I introduced this problem when I reworked the safebase to be more uptodate in its use of Tcl's features. Reassigning to myself.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [9b2cb2f4f5] (rid 111084) by andreas_kupries on 2009-12-02 00:00:22:
- assignee changed to: "andreas_kupries"
Ticket change [0a01ef50bc] (rid 113743) by andreas_kupries on 2009-12-02 00:15:24:
- closedate changed to: "2009-12-01T17:15:24"
- closer changed to: "andreas_kupries"
- icomment:
Hm. What is your revision of safe.tcl ? (Installed under [info library], see the RCS comment line at the top). Mine is CVS head as of the time of this comment, revision 1.33, and I do not see the problem/error. The relevant code in my file safe.tcl is try { ::interp invokehidden $slave glob {*}$cmd * } on ok msg { *# Nothing to be done, just capture the 'msg' for later. } on error msg { Log $slave $msg return -code error "script error" } Log $slave "GLOB @ $msg" NOTICE and the lines I marked with * are presumably missing in your revision ... Checking the ChangeLog I also find 2009-10-05 Andreas Kupries <[email protected]> * library/safe.tcl (AliasGlob): Fixed conversion of catch to try/finally, it had an 'on ok msg' branch missing, causing a silent error immediately, and bogus glob results, breaking search for Tcl modules. which looks to me is the problem you are running into. MY guess is that your Tcl is older than that entry. - login: "andreas_kupries"
- mimetype: "text/plain"
- resolution changed to: "Out of Date"
- status changed to: "Pending"
- username: "andreas_kupries"
Ticket change [4c788e5ef0] (rid 126897) by andreas_kupries on 2009-12-02 00:15:42:
- title changed to:
calling [glob ../*] in an safe interp returns weird things
- title changed to:
Add attachment "safe.tcl" [cc2f236952] (rid 95647) by john13a on 2009-12-02 00:27:23.
Ticket change [71b91b0933] (rid 100736) by john13a on 2009-12-02 00:27:23:
- icomment:
File Added - 353442: safe.tcl
- login: "john13a"
- mimetype: "text/plain"
- username: "john13a"
- icomment:
Ticket change [312f675a9d] (rid 93381) by john13a on 2009-12-02 00:31:05:
- icomment:
See uploaded files. :) 8.5.7: # RCS: @(#) $Id: safe.tcl,v 1.16.4.1 2008/06/25 16:42:05 andreas_kupries Exp $ 8.6b1.1 # RCS: @(#) $Id: safe.tcl,v 1.18 2009/07/26 11:40:24 dkf Exp $
- login: "john13a"
- mimetype: "text/plain"
- username: "john13a"
- icomment:
Ticket change [55efa5b6c9] (rid 94239) by john13a on 2009-12-02 00:31:06:
- status changed to: "Open"
Ticket change [51f8f5b931] (rid 126226) by andreas_kupries on 2009-12-02 00:52:20:
- icomment:
Definitely the old buggy code I fixed on 2009-10-05 (The first fixed revision was rev 1.19). http://tcl.cvs.sourceforge.net/viewvc/tcl/tcl/library/safe.tcl?r1=1.18&r2=1.19 You need a newer Tcl to get the fix.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [90f50ff38f] (rid 120547) by andreas_kupries on 2009-12-02 00:52:21:
- closedate changed to: "2009-12-01T17:52:21"
- closer changed to: "andreas_kupries"
- icomment:
allow_comments - 1
- login: "andreas_kupries"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "andreas_kupries"
Ticket change [89f2e3fa89] (rid 127308) by dkf on 2009-12-02 22:48:17:
- icomment:
allow_comments - 0 With safe.tcl 1.33 in the tip of the 8.5 branch, I get globbing where I wouldn't expect it: bash$ make -C unix shell DYLD_LIBRARY_PATH="`pwd`:${DYLD_LIBRARY_PATH}"; export DYLD_LIBRARY_PATH; \ TCL_LIBRARY="/Users/dkf/Documents/software/tcl8.5/library"; export TCL_LIBRARY; \ ./tclsh % safe::interpCreate test test % test eval glob ../* ../ChangeLog ../ChangeLog.1999 ../ChangeLog.2000 ../ChangeLog.2001 ../ChangeLog.2002 ../ChangeLog.2003 ../ChangeLog.2004 ../ChangeLog.2005 ../ChangeLog.~1.3975.2.269.~ ../changes ../compat ../CVS ../doc ../generic ../library ../libtommath ../license.terms ../macosx ../README ../tests ../tools ../unix ../win - login: "dkf"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dkf"
- icomment:
Ticket change [ce77f211bc] (rid 96060) by dkf on 2009-12-02 22:52:39:
- icomment:
Correction, that's with 1.16.4.2
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [e267cd3682] (rid 87615) by dkf on 2009-12-03 21:09:21:
- icomment:
OK, with digging around I find that this security bug was introduced with the fix for [Bug 1999119] (enabling Tcl Module support) which corresponds to the 1.16->1.17 or 1.16->1.16.4.1 change. The issue is that AliasGlob does not check for directory components in the pattern arguments to [glob], let alone work out whether those components refer to to locations that are "bad". :-(
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dkf"
- icomment:
Ticket change [63a3bc8295] (rid 92617) by dkf on 2009-12-03 22:51:40:
- assignee changed to: "dkf"
- icomment:
Fixed for 8.6 HEAD I think, but needs review and backport (can't just use patch; 8.6 version uses [try]).
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "dkf"
Ticket change [7a3cb0a350] (rid 90277) by dkf on 2009-12-04 16:26:00:
- icomment:
More work required. Currently we handle many things wrongly anyway
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [ab78b44756] (rid 101124) by dkf on 2009-12-04 16:27:39:
- icomment:
Notable issues: 1. we check the second -directory option 2. we don't handle -nocomplain 3. we get confused by glob metachars in the path part of a pattern
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [c2488df307] (rid 111461) by dkf on 2009-12-04 23:37:54:
- icomment:
Correction, we pass -nocomplain through, but if we've got it, we fail noisily in some cases where we shouldn't (i.e., with paths that are non-readable by policy).
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [c20ab3861d] (rid 111432) by dkf on 2009-12-17 06:45:39:
- closedate changed to: "2009-12-16T23:45:39"
- closer changed to: "dkf"
- icomment:
allow_comments - 1 Rewrote to allow more options (-types is fine) and to be more careful with anything with path implications (-join is tricky!)
- login: "dkf"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "dkf"