From 13515e3f357dbe28bc7a0d420aa4c89db2d23561 Mon Sep 17 00:00:00 2001 From: hobbs Date: Fri, 22 Feb 2002 19:51:29 +0000 Subject: * library/safe.tcl (CheckFileName): removed the limit on sourceable file names (was only *.tcl or tclIndex files with no more than one dot and 14 chars). There is enough internal protection in a safe interpreter already. Fixes [Tk Bug #521560]. --- library/safe.tcl | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/library/safe.tcl b/library/safe.tcl index 6d4c41b..9faeffe 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.7 2000/11/24 13:56:40 dkf Exp $ +# RCS: @(#) $Id: safe.tcl,v 1.8 2002/02/22 19:51:29 hobbs Exp $ # # The implementation is based on namespaces. These naming conventions @@ -695,24 +695,14 @@ proc ::safe::setLogCmd {args} { } } - + # file name control (limit access to files/ressources that should be # a valid tcl source file) proc CheckFileName {slave file} { - # limit what can be sourced to .tcl - # and forbid files with more than 1 dot and - # longer than 14 chars - set ftail [file tail $file] - if {[string length $ftail]>14} { - error "$ftail: filename too long" - } - if {[regexp {\..*\.} $ftail]} { - error "$ftail: more than one dot is forbidden" - } - if {[string compare $ftail "tclIndex"] && \ - [string compare -nocase [file extension $ftail] ".tcl"]} { - error "$ftail: must be a *.tcl or tclIndex" - } + # This used to limit what can be sourced to ".tcl" and forbid files + # with more than 1 dot and longer than 14 chars, but I changed that + # for 8.4 as a safe interp has enough internal protection already + # to allow sourcing anything. - hobbs if {![file exists $file]} { # don't tell the file path -- cgit v0.12