diff options
author | hobbs <hobbs@noemail.net> | 2003-07-16 22:49:31 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2003-07-16 22:49:31 (GMT) |
commit | bf91ef9feeb2e675627f15e2cfaaf9fa0b8cd78c (patch) | |
tree | 9c0ccdc9db2d126b8fc3bd9d97f13a4ea7ecdaa1 /library | |
parent | 653576f2538bb205f8e4533ee5893fa6a11e075f (diff) | |
download | tcl-bf91ef9feeb2e675627f15e2cfaaf9fa0b8cd78c.zip tcl-bf91ef9feeb2e675627f15e2cfaaf9fa0b8cd78c.tar.gz tcl-bf91ef9feeb2e675627f15e2cfaaf9fa0b8cd78c.tar.bz2 |
* library/safe.tcl (FileInAccessPath): normalize paths before
comparison. [Bug 759607] (myers)
FossilOrigin-Name: c758f157540d0d67d6b73967a42beb96cc01c316
Diffstat (limited to 'library')
-rw-r--r-- | library/safe.tcl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/library/safe.tcl b/library/safe.tcl index a259bdb..a5252d8 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: safe.tcl,v 1.9 2003/02/08 22:03:20 hobbs Exp $ +# RCS: @(#) $Id: safe.tcl,v 1.9.2.1 2003/07/16 22:49:31 hobbs Exp $ # # The implementation is based on namespaces. These naming conventions @@ -837,7 +837,15 @@ proc ::safe::setLogCmd {args} { error "\"$file\": is a directory" } set parent [file dirname $file] - if {[lsearch -exact $access_path $parent] == -1} { + + # Normalize paths for comparison since lsearch knows nothing of + # potential pathname anomalies. + set norm_parent [file normalize $parent] + foreach path $access_path { + lappend norm_access_path [file normalize $path] + } + + if {[lsearch -exact $norm_access_path $norm_parent] == -1} { error "\"$file\": not in access_path" } } |