Tcl Source Code

View Ticket
Login
Ticket UUID: 8e53aea5b9c09f13622410ae4daf381a38e0cb0b
Title: Safe interpreter paths differ from non-safe (test safe-14.1 fails)
Type: Bug Version: tcl-8.6.4
Submitter: jskarvad Created on: 2015-07-15 17:04:11
Subsystem: 20. [interp] Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2015-07-17 18:05:23
Resolution: None Closed By: nobody
    Closed on:
Description:
I am not sure whether the category is correct, but I encountered the following problem with the safe interpreter - the test safe-14.1 fails if run by the installed interpreter. It fails because the paths of safe and normal interpreter are different.

The problem is that the safe interpreter recursively descends into directories which may add paths that are not in the 'tm::path'. I.e. I am getting the following:

---- Result was:
/usr/lib/tcl8/site-tcl /usr/lib/tcl8/8.0 /usr/lib/tcl8/8.1 /usr/lib/tcl8/8.2 /usr/lib/tcl8/8.3 /usr/lib/tcl8/8.4 /usr/lib/tcl8/8.5 /usr/share/tcl8/site-tcl /usr/share/tcl8/8.0 /usr/share/tcl8/8.1 /usr/share/tcl8/8.2 /usr/share/tcl8/8.3 /usr/share/tcl8/8.4 /usr/share/tcl8/8.5 /usr/share/tcl8/8.4/platform
---- Result should have been (exact matching):
/usr/lib/tcl8/site-tcl /usr/lib/tcl8/8.0 /usr/lib/tcl8/8.1 /usr/lib/tcl8/8.2 /usr/lib/tcl8/8.3 /usr/lib/tcl8/8.4 /usr/lib/tcl8/8.5 /usr/share/tcl8/site-tcl /usr/share/tcl8/8.0 /usr/share/tcl8/8.1 /usr/share/tcl8/8.2 /usr/share/tcl8/8.3 /usr/share/tcl8/8.4 /usr/share/tcl8/8.5

The /usr/share/tcl8/8.4/platform is extra directory added to safe interpreter by descending deeper into /usr/share/tcl8/8.4. It is added by the following snip of safe.tcl:

# [Bug 2854929]
# Recursively find deeper paths which may contain
# modules. Required to handle modules with names like
# 'platform::shell', which translate into
# 'platform/shell-X.tm', i.e arbitrarily deep
# subdirectories.
lappend morepaths {*}[glob -nocomplain -directory $dir -type d *]

Is it the correct fix? Are safe intepreter paths allowed to be different?
User Comments: jskarvad added on 2015-07-15 17:08:43:
The original ticket that introduced this:
http://core.tcl.tk/tcl/tktview?name=2854929fffffffff