summaryrefslogtreecommitdiffstats
path: root/library/safe.tcl
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2020-07-21 17:34:03 (GMT)
committerkjnash <k.j.nash@usa.net>2020-07-21 17:34:03 (GMT)
commit720183a9af204a0db0d0211ea410609891ebd9d6 (patch)
tree5ff93bb4a5c5f708415d53ed68ec9c26a2959b47 /library/safe.tcl
parent14cfbc651c24aa44c83023e8bba2781d322b230f (diff)
downloadtcl-720183a9af204a0db0d0211ea410609891ebd9d6.zip
tcl-720183a9af204a0db0d0211ea410609891ebd9d6.tar.gz
tcl-720183a9af204a0db0d0211ea410609891ebd9d6.tar.bz2
In ::safe::interpFindInAccessPath, ::safe::interpAddToAccessPath, add a check that the interpreter belongs to the Safe Base. Add comments on why this is not done for ::safe::interpDelete.
Diffstat (limited to 'library/safe.tcl')
-rw-r--r--library/safe.tcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/safe.tcl b/library/safe.tcl
index 6b531be..3e8c2c6 100644
--- a/library/safe.tcl
+++ b/library/safe.tcl
@@ -444,6 +444,7 @@ proc ::safe::InterpSetConfig {slave access_path staticsok nestedok deletehook} {
# Search for a real directory and returns its virtual Id (including the
# "$")
proc ::safe::interpFindInAccessPath {slave path} {
+ CheckInterp $slave
namespace upvar ::safe [VarName $slave] state
if {![dict exists $state(access_path,remap) $path]} {
@@ -460,6 +461,7 @@ proc ::safe::interpFindInAccessPath {slave path} {
proc ::safe::interpAddToAccessPath {slave path} {
# first check if the directory is already in there
# (inlined interpFindInAccessPath).
+ CheckInterp $slave
namespace upvar ::safe [VarName $slave] state
if {[dict exists $state(access_path,remap) $path]} {
@@ -591,11 +593,15 @@ proc ::safe::AddSubDirs {pathList} {
}
# This procedure deletes a safe slave managed by Safe Tcl and cleans up
-# associated state:
+# associated state.
+# - The command will also delete non-Safe-Base interpreters.
+# - This is regrettable, but to avoid breaking existing code this should be
+# amended at the next major revision by uncommenting "CheckInterp".
proc ::safe::interpDelete {slave} {
Log $slave "About to delete" NOTICE
+ # CheckInterp $slave
namespace upvar ::safe [VarName $slave] state
# When an interpreter is deleted with [interp delete], any sub-interpreters