summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-06-27 21:00:45 (GMT)
committerhobbs <hobbs>2001-06-27 21:00:45 (GMT)
commit612a1b3161165bb6c62c75d298ae52e4552b1f85 (patch)
treea46fec7a979c34696a13ea1368a12c6c63c20457 /doc
parent4639672056e18ec52043f2e4c889b68accda6d8d (diff)
downloadtcl-612a1b3161165bb6c62c75d298ae52e4552b1f85.zip
tcl-612a1b3161165bb6c62c75d298ae52e4552b1f85.tar.gz
tcl-612a1b3161165bb6c62c75d298ae52e4552b1f85.tar.bz2
* doc/interp.n:
* doc/unknown.n: updated notes about what is in a safe interp. [Bug #218605]
Diffstat (limited to 'doc')
-rw-r--r--doc/interp.n57
-rw-r--r--doc/unknown.n13
2 files changed, 51 insertions, 19 deletions
diff --git a/doc/interp.n b/doc/interp.n
index 6ed1d58..e2d491c 100644
--- a/doc/interp.n
+++ b/doc/interp.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: interp.n,v 1.5 1999/09/02 16:26:11 hobbs Exp $
+'\" RCS: @(#) $Id: interp.n,v 1.6 2001/06/27 21:00:45 hobbs Exp $
'\"
.so man.macros
.TH interp n 7.6 Tcl "Tcl Built-In Commands"
@@ -381,15 +381,15 @@ close concat continue eof
error eval expr fblocked
fcopy fileevent flush for
foreach format gets global
-history if incr info
-interp join lappend lindex
-linsert list llength lrange
-lreplace lsearch lsort namespace
-package pid proc puts
-read regexp regsub rename
-return scan seek set
-split string subst switch
-tell trace unset update
+if incr info interp
+join lappend lindex linsert
+list llength lrange lreplace
+lsearch lsort namespace package
+pid proc puts read
+regexp regsub rename return
+scan seek set split
+string subst switch tell
+time trace unset update
uplevel upvar variable vwait
while\fR
.DE
@@ -398,12 +398,43 @@ The following commands are hidden by \fBinterp create\fR when it
creates a safe interpreter:
.DS
.ta 1.2i 2.4i 3.6i
-\fBcd exec exit fconfigure
-file glob load open
-pwd socket source vwait\fR
+\fBcd encoding exec exit
+fconfigure file glob load
+open pwd socket source\fR
.DE
These commands can be recreated later as Tcl procedures or aliases, or
re-exposed by \fBinterp expose\fR.
+.PP
+The following commands from Tcl's library of support procedures are
+not present in a safe interpreter:
+.DS
+.ta 1.6i 3.2i
+\fBauto_exec_ok auto_import auto_load
+auto_load_index auto_qualify unknown\fR
+.DE
+Note in particular that safe interpreters have no default \fBunknown\fR
+command, so Tcl's default autoloading facilities are not available.
+Autoload access to Tcl's commands that are normally autoloaded:
+.DS
+.ta 2.1i
+\fB
+auto_mkindex auto_mkindex_old
+auto_reset history
+parray pkg_mkIndex
+::pkg::create ::safe::interpAddToAccessPath
+::safe::interpCreate ::safe::interpConfigure
+::safe::interpDelete ::safe::interpFindInAccessPath
+::safe::interpInit ::safe::setLogCmd
+tcl_endOfWord tcl_findLibrary
+tcl_startOfNextWord tcl_startOfPreviousWord
+tcl_wordBreakAfter tcl_wordBreakBefore\fR
+.DE
+can only be provided by explicit definition of an \fBunknown\fR command
+in the safe interpreter. This will involve exposing the \fBsource\fR
+command. This is most easily accomplished by creating the safe interpreter
+with Tcl's \fBSafe\-Tcl\fR mechanism. \fBSafe\-Tcl\fR provides safe
+versions of \fBsource\fB, \fBload\fR, and other Tcl commands needed
+to support autoloading of commands and the loading of packages.
.VE
.PP
In addition, the \fBenv\fR variable is not present in a safe interpreter,
diff --git a/doc/unknown.n b/doc/unknown.n
index d95cd33..2ef5b14 100644
--- a/doc/unknown.n
+++ b/doc/unknown.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: unknown.n,v 1.3 2000/09/07 14:27:52 poenitz Exp $
+'\" RCS: @(#) $Id: unknown.n,v 1.4 2001/06/27 21:00:45 hobbs Exp $
'\"
.so man.macros
.TH unknown n "" Tcl "Tcl Built-In Commands"
@@ -20,10 +20,11 @@ unknown \- Handle attempts to use non-existent commands
.SH DESCRIPTION
.PP
This command is invoked by the Tcl interpreter whenever a script
-tries to invoke a command that doesn't exist. The implementation
-of \fBunknown\fR isn't part of the Tcl core; instead, it is a
-library procedure defined by default when Tcl starts up. You
-can override the default \fBunknown\fR to change its functionality.
+tries to invoke a command that doesn't exist. The default implementation
+of \fBunknown\fR is a library procedure defined when Tcl initializes an
+interpreter. You can override the default \fBunknown\fR to change its
+functionality. Note that there is no default implementation of
+\fBunknown\fR in a safe interpreter.
.PP
If the Tcl interpreter encounters a command name for which there
is not a defined command, then Tcl checks for the existence of
@@ -72,7 +73,7 @@ is the return value from the command that was eventually
executed.
.SH "SEE ALSO"
-info(n), proc(n)
+info(n), proc(n), interp(n), library(n)
.SH KEYWORDS
error, non-existent command