diff options
author | kjnash <k.j.nash@usa.net> | 2020-07-21 03:59:35 (GMT) |
---|---|---|
committer | kjnash <k.j.nash@usa.net> | 2020-07-21 03:59:35 (GMT) |
commit | 204434e4d41bb9e07b48d28331a6a63206dc36dd (patch) | |
tree | ebaaa292baed156fc0b2f88e6a3060fc14c6881b | |
parent | e6a9f22409462ec90bb2009619173c4228809317 (diff) | |
download | tcl-204434e4d41bb9e07b48d28331a6a63206dc36dd.zip tcl-204434e4d41bb9e07b48d28331a6a63206dc36dd.tar.gz tcl-204434e4d41bb9e07b48d28331a6a63206dc36dd.tar.bz2 |
Use suitable -errorcode in safe::AliasSource if file does not exist or is unreadable. Fixes bug f3ba57600d.
-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 |