From 7babac4bf486dcf01e87c9283ef4adf85b7e2cef Mon Sep 17 00:00:00 2001 From: hobbs Date: Wed, 16 Jul 2003 22:49:12 +0000 Subject: * library/safe.tcl (FileInAccessPath): normalize paths before comparison. [Bug 759607] (myers) --- ChangeLog | 3 +++ library/safe.tcl | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 331c052..8a5138e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-07-16 Jeff Hobbs + * library/safe.tcl (FileInAccessPath): normalize paths before + comparison. [Bug 759607] (myers) + * unix/tclUnixNotfy.c (NotifierThreadProc): correct size of found and word vars from int to long. [Bug 767578] (hgo) diff --git a/library/safe.tcl b/library/safe.tcl index 6646962..541bdec 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.10 2003/03/19 21:57:44 dgp Exp $ +# RCS: @(#) $Id: safe.tcl,v 1.11 2003/07/16 22:49:12 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" } } -- cgit v0.12