diff options
-rw-r--r-- | library/safe.tcl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/library/safe.tcl b/library/safe.tcl index 4540be3..9b8a04f 100644 --- a/library/safe.tcl +++ b/library/safe.tcl @@ -968,12 +968,15 @@ proc ::safe::AliasSource {slave args} { return -code error "permission denied" } - # do the checks on the filename : + # Check that the filename exists and is readable. If it is not, deliver + # this -errorcode so that caller in tclPkgUnknown does not write a message + # to tclLog. Has no effect on other callers of ::source, which are in + # "package ifneeded" scripts. if {[catch { CheckFileName $slave $realfile } msg]} { Log $slave "$realfile:$msg" - return -code error $msg + return -code error -errorcode {POSIX EACCES} $msg } # Passed all the tests, lets source it. Note that we do this all manually |