head	1.16;
access;
symbols
	core-8-5-9:1.12
	core-8-5-8:1.12
	macosx-cocoa-merge:1.13
	macosx-cocoa-premerge:1.13
	macosx-carbon-freeze:1.13
	core-8-5-7:1.12
	core-8-5-6:1.12
	core-8-6-b1:1.13
	core-8-6-a3:1.13
	core-8-5-5:1.12
	core-8-6-a2:1.13
	core-8-5-4:1.12
	core-8-5-3:1.12
	core-8-6-a1:1.12
	core-8-4-19:1.5.2.2
	core-8-5-branch:1.12.0.2
	core-8-5-2:1.12
	core-8-4-18:1.5.2.2
	core-8-5-1:1.12
	core-8-4-17:1.5.2.2
	core-8-5-0:1.12
	core-8-5-b3:1.10
	core-8-5-b2:1.9
	core-8-4-16:1.5.2.2
	core-8-5-b1:1.7
	core-stablilizer-merge:1.7
	core-stabilizer-branch:1.7.0.2
	core-stabilizer-merge:1.12
	core-8-4-15:1.5.2.2
	core-8-5-a6:1.7
	core-8-5-a5:1.7
	core-8-4-14:1.5.2.2
	core-8-5-a4:1.7
	core-8-4-13:1.5.2.2
	core-8-4-12:1.5.2.2
	core-8-4-11:1.5.2.2
	core-8-5-a3:1.7
	core-8-4-10:1.5.2.2
	core-8-4-9-branch:1.5.2.1.0.2
	core-8-5-a2:1.6
	core-8-4-9:1.5.2.1
	core-8-4-8:1.5.2.1
	core-8-4-7:1.5
	core-8-5-a1:1.5
	core-8-4-6:1.5
	core-8-4-5:1.5
	mistachkin-dev-branch:1.5.0.4
	core-8-4-4:1.5
	core-8-4-3:1.5
	core-8-4-branch:1.5.0.2
	core-8-4-2:1.5
	core-8-4-1:1.4
	core-8-3-5:1.3.18.1
	core-8-4-0:1.4
	macosx-8-4-merge-2002-08-31-trunk:1.4
	macosx-8-4-premerge-2002-08-31-branch:1.4
	macosx-8-4-premerge-2002-08-31-trunk:1.4
	macosx-8-4-merge-2002-08-30-branch:1.4
	macosx-8-4-merge-2002-08-30-trunk:1.4
	macosx-8-4-merge-2002-08-20-branch:1.4
	macosx-8-4-merge-2002-08-20-trunk:1.4
	core-8-4-b2:1.4
	core-8-4-b1:1.4
	macosx-premerge-6-9-02:1.4
	core-8-4-a4:1.4
	core-8-3-4:1.3.18.1
	macosx-8-4-branch:1.4.0.6
	macosx-8-4-branchpoint:1.4
	core-8-4-a3:1.4
	core-8-3-3:1.3.18.1
	dgp-privates-into-namespace:1.4.0.4
	tclpro-1-5-0:1.3
	core-8-4-win-speedup:1.4.0.2
	core-8-4-a2:1.4
	tclpro-1-4-1:1.3
	tclpro-1-4-0:1.3
	core-8-3-2:1.3
	ajuba-ajuba2-2-1-base:1.3
	ajuba-ajuba2-2-0:1.3
	core-8-4-a1:1.3
	core-8-3-1-branch:1.3.0.18
	core-8-3-1:1.3
	scriptics-sc-2-0-b5:1.3
	scriptics-sc-2-0-fixed:1.3
	scriptics-sc-2-0-b2:1.3
	scriptics-sc-2-0-b1:1.3
	core-8-3-0:1.3
	core-8-3-b2:1.3
	core-8-3-b1:1.3
	scriptics-sc-1-1:1.3
	scriptics-sc-1-1-b1:1.3
	core-8-2-3:1.3
	scriptics-sc-1-1-branch:1.3.0.16
	scriptics-sc-1-1-base:1.3
	scriptics-sc-1-0:1.3
	scriptics-sc-1-0-branch:1.3.0.14
	scriptics-sc-1-0-base:1.3
	core-8-2-2:1.3
	core-8-2-1:1.3
	scriptics-bc-1-0-b1:1.3
	core-8-2-1-branch:1.3.0.12
	scriptics-tclpro-1-3-0:1.3
	core-8-2-0:1.3
	core-8-2-b3-branch:1.3.0.10
	core-8-2-b3-base:1.3
	scriptics-tclpro-1-3-b4:1.3
	core-8-2-b2:1.3
	scriptics-tclpro-1-3-b3:1.3
	core-8-2-b1:1.3
	scriptics-tclpro-1-3-b2:1.3
	merge-to-mainline-5/21/99:1.3
	scriptics-tclpro-1-3-b2-branch:1.3.0.8
	core-8-1-1:1.3
	scriptics-tclpro-1-3-b1:1.3
	core-8-1-1-base:1.3
	core-8-1-0:1.3
	merge-to-mainline-4-29-99:1.3
	merge-to-mainline-4-23-99:1.3
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.3.0.6
	core-8-0-6-base:1.3
	core-8-0-5:1.3
	core-8-1-b3:1.1.4.2
	core-8-1-b2:1.1.4.2
	dev-8-1-stubs-branch:1.1.4.2.0.2
	dev-stubs-branch:1.3.0.4
	scriptics-tclpro-1-2:1.3
	scriptics-tclpro-1-2-b2:1.3
	core-8-1-merge-2/10/99:1.3
	core-8-0-5-branch:1.3.0.2
	core-8-0-5-base:1.3
	scriptics-tclpro-1-2-b1:1.3
	scriptics-tclpro-1-2-a1:1.3
	core-8-1-b1:1.1.4.2
	core-8-0-4:1.3
	core-8-1-a2:1.1.4.1
	core-8-0-2:1.1
	core-8-0-3:1.3;
locks; strict;
comment	@# @;


1.16
date	2010.01.14.14.00.39;	author dkf;	state Exp;
branches;
next	1.15;

1.15
date	2009.11.01.23.49.50;	author mistachkin;	state Exp;
branches;
next	1.14;

1.14
date	2009.08.06.12.46.07;	author dkf;	state Exp;
branches;
next	1.13;

1.13
date	2008.06.30.22.57.03;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2007.12.13.15.23.43;	author dgp;	state Exp;
branches;
next	1.11;

1.11
date	2007.12.10.16.21.48;	author jenglish;	state Exp;
branches;
next	1.10;

1.10
date	2007.10.29.16.04.13;	author dkf;	state Exp;
branches;
next	1.9;

1.9
date	2007.10.26.20.13.23;	author dgp;	state Exp;
branches;
next	1.8;

1.8
date	2007.10.24.14.32.58;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2005.01.05.16.40.39;	author dkf;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2004.09.01.09.37.49;	author dkf;	state Exp;
branches;
next	1.5;

1.5
date	2003.01.19.07.51.15;	author hobbs;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2000.09.07.17.38.16;	author hobbs;	state Exp;
branches;
next	1.3;

1.3
date	98.09.14.18.22.57;	author stanton;	state Exp;
branches
	1.3.18.1;
next	1.2;

1.2
date	98.06.27.18.03.10;	author welch;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.39.53;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.29.00.25.10;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	98.09.30.02.16.21;	author stanton;	state Exp;
branches;
next	;

1.3.18.1
date	2001.04.04.07.23.48;	author hobbs;	state Exp;
branches;
next	;

1.5.2.1
date	2004.10.28.10.19.29;	author dkf;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	2005.01.05.21.57.17;	author dkf;	state Exp;
branches;
next	;

1.7.2.1
date	2007.11.01.16.37.15;	author dgp;	state Exp;
branches;
next	1.7.2.2;

1.7.2.2
date	2007.12.10.18.39.28;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.16
log
@Adjust formatting to make this look nicer
@
text
@'\"
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: loadTk.n,v 1.15 2009/11/01 23:49:50 mistachkin Exp $
'\" 
.so man.macros
.TH "Safe Tk" n 8.0 Tk "Tk Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
safe::loadTk \- Load Tk into a safe interpreter.
.SH SYNOPSIS
\fBsafe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? 
.BE
.SH DESCRIPTION
.PP
Safe Tk is based on Safe Tcl, which provides a mechanism that allows
restricted and mediated access to auto-loading and packages for safe
interpreters.  Safe Tk adds the ability to configure the interpreter for safe
Tk operations and load Tk into safe interpreters.
.PP
The \fBsafe::loadTk\fR command initializes the required data structures in
the named safe interpreter and then loads Tk into it.  The interpreter must
have been created with \fBsafe::interpCreate\fR or have been initialized
with \fBsafe::interpInit\fR.  The command returns the name of the safe
interpreter.  If \fB\-use\fR is specified, the window identified by the
specified system dependent identifier \fIwindowId\fR is used to contain the
.QW .
window of the safe interpreter; it can be any valid id, eventually referencing
a window belonging to another application. As a convenience, if the window you
plan to use is a Tk Window of the application you can use the window name
(e.g.,
.QW \fB.x.y\fR )
instead of its window Id (e.g., from \fBwinfo id\fR \fB.x.y\fR).
When \fB\-use\fR is not specified, a new toplevel window is created for the
.QW .
window of the safe interpreter. On X11 if you want the embedded window to use
another display than the default one, specify it with \fB\-display\fR.  See
the \fBSECURITY ISSUES\fR section below for implementation details.
.SH "SECURITY ISSUES"
.PP
Please read the \fBsafe\fR manual page for Tcl to learn about the basic
security considerations for Safe Tcl.
.PP
\fBsafe::loadTk\fR adds the value of \fBtk_library\fR taken from the master
interpreter to the virtual access path of the safe interpreter so that
auto-loading will work in the safe interpreter.
.PP
Tk initialization is now safe with respect to not trusting the slave's state
for startup. \fBsafe::loadTk\fR registers the slave's name so when the Tk
initialization (\fBTk_SafeInit\fR) is called and in turn calls the master's
\fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent
(\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.)
.PP
When \fB\-use\fR is not used, the new toplevel created is specially decorated
so the user is always aware that the user interface presented comes from a
potentially unsafe code and can easily delete the corresponding interpreter.
.PP
On X11, conflicting \fB\-use\fR and \fB\-display\fR are likely to generate a
fatal X error.
.SH "SEE ALSO"
safe(n), interp(n), library(n), load(n), package(n), source(n), unknown(n)
.SH KEYWORDS
alias, auto-loading, auto_mkindex, load, master interpreter, safe
interpreter, slave interpreter, source
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.15
log
@minor doc fix for htmlhelp
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.14 2009/08/06 12:46:07 dkf Exp $
d14 1
a14 1
loadTk \- Load Tk into a safe interpreter.
d16 1
a16 1
\fB::safe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? 
d25 1
a25 1
The \fB::safe::loadTk\fR command initializes the required data structures in
d27 2
a28 2
have been created with \fB::safe::interpCreate\fR or have been initialized
with \fB::safe::interpInit\fR.  The command returns the name of the safe
d37 1
a37 2
instead of its window Id (e.g.,
.QW "\fB[winfo id .x.y]\fR" ).
d48 1
a48 1
\fB::safe::loadTk\fR adds the value of \fBtk_library\fR taken from the master
d53 1
a53 1
for startup. \fB::safe::loadTk\fR registers the slave's name so when the Tk
d55 1
a55 1
\fB::safe::InitTk\fR it will return the desired \fBargv\fR equivalent
@


1.14
log
@Small updates for minor issues
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.13 2008/06/30 22:57:03 dkf Exp $
d38 1
a38 1
.QW \fB[winfo id .x.y]\fR ).
@


1.13
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.12 2007/12/13 15:23:43 dgp Exp $
d19 12
a30 14
Safe Tk is based on Safe Tcl, which provides a mechanism 
that allows restricted and mediated
access to auto-loading and packages for safe interpreters.
Safe Tk adds the ability to configure the interpreter
for safe Tk operations and load Tk into safe 
interpreters.
.PP
The \fB::safe::loadTk\fR command initializes the required data structures
in the named safe interpreter and then loads Tk into it.
The interpreter must have been created with \fB::safe::interpCreate\fR
or have been initialized with \fB::safe::interpInit\fR.
The command returns the name of the safe interpreter.
If \fB\-use\fR is specified, the window identified by the specified system
dependent identifier \fIwindowId\fR is used to contain the
d32 8
a39 7
window of the safe interpreter; it can be any valid id, eventually 
referencing a window belonging to another application. As a convenience,
if the window you plan to use is a Tk Window of the application you
can use the window name (e.g. \fB.x.y\fR) instead of its window Id 
(\fB[winfo id .x.y]\fR).
When \fB\-use\fR is not specified,
a new toplevel window is created for the
d41 3
a43 5
window of
the safe interpreter. On X11 if you want the embedded window
to use another display than the default one, specify it with
\fB\-display\fR.
See the \fBSECURITY ISSUES\fR section below for implementation details.
d53 9
d63 2
a64 15
Tk initialization is now safe with respect to not trusting
the slave's state for startup. \fB::safe::loadTk\fR
registers the slave's name so
when the Tk initialization (\fBTk_SafeInit\fR) is called
and in turn calls the master's \fB::safe::InitTk\fR it will
return the desired \fBargv\fR equivalent (\fB\-use\fR 
\fIwindowId\fR, correct \fB\-display\fR, etc.)
.PP
When \fB\-use\fR is not used, the new toplevel created is specially
decorated so the user is always aware that the user interface presented comes
from a potentially unsafe code and can easily delete the corresponding
interpreter.
.PP
On X11, conflicting \fB\-use\fR and \fB\-display\fR are likely
to generate a fatal X error.
d68 1
a68 1
alias, auto\-loading, auto_mkindex, load, master interpreter, safe
@


1.12
log
@merge stable branch onto HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.7.2.2 2007/12/10 18:39:28 dgp Exp $
a46 1

a71 1

a73 1
 
a76 1

@


1.11
log
@Various markup fixes
(mostly: missing quotes on .SH arguments, extraneous .PPs)
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.10 2007/10/29 16:04:13 dkf Exp $
@


1.10
log
@Lots more GOOBE stuff. Now works with 'make html'!
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.9 2007/10/26 20:13:23 dgp Exp $
d18 1
a18 1

a24 2

.SH DESCRIPTION
@


1.9
log
@        * doc/*.1:              Revert doc changes that broke
        * doc/*.3:              `make html` so we can get the release
        * doc/*.n:              out the door.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.7 2005/01/05 16:40:39 dkf Exp $
d34 2
a35 1
dependent identifier \fIwindowId\fR is used to contain the ``.''
d42 3
a44 1
a new toplevel window is created for the ``.'' window of
@


1.8
log
@Lots of improvements to look and feel of manual pages
@
text
@d34 1
a34 2
dependent identifier \fIwindowId\fR is used to contain the
.QW .
d40 3
a42 3
When \fB\-use\fR is not specified, a new toplevel window is created for the
.QW .
window of the safe interpreter. On X11 if you want the embedded window
d46 1
d72 1
d75 1
@


1.7
log
@Move emacs mode comment to end of file to stop problems with old man.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.6 2004/09/01 09:37:49 dkf Exp $
d34 2
a35 1
dependent identifier \fIwindowId\fR is used to contain the ``.''
d41 3
a43 3
When \fB\-use\fR is not specified,
a new toplevel window is created for the ``.'' window of
the safe interpreter. On X11 if you want the embedded window
a46 1

a71 1

a73 1
 
@


1.7.2.1
log
@merge updates from HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.7 2005/01/05 16:40:39 dkf Exp $
d34 1
a34 2
dependent identifier \fIwindowId\fR is used to contain the
.QW .
d41 1
a41 3
a new toplevel window is created for the
.QW .
window of
@


1.7.2.2
log
@merge updates from HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.7.2.1 2007/11/01 16:37:15 dgp Exp $
d18 1
a18 1
.SH DESCRIPTION
d25 2
@


1.6
log
@More doc fixes from Mikhail Kolesnitchenko
@
text
@a0 1
'\" -*- nroff -*-
d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.5 2003/01/19 07:51:15 hobbs Exp $
d79 4
@


1.5
log
@	* doc/loadTk.n: note that ::safe::loadTk has a prereq on
	::safe::interpCreate or ::safe::interpInit. [Bug #669159]
@
text
@d1 1
d8 1
a8 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.4 2000/09/07 17:38:16 hobbs Exp $
d39 1
a39 1
can use the window name (eg: \fB.x.y\fR) instead of its window Id 
d64 1
a64 1
\fIwindowId\fR, correct \fB\-display\fR, etc...).
@


1.5.2.1
log
@Backport of documentation fixes
@
text
@a0 1
'\" -*- nroff -*-
d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.5 2003/01/19 07:51:15 hobbs Exp $
d38 1
a38 1
can use the window name (e.g. \fB.x.y\fR) instead of its window Id 
d63 1
a63 1
\fIwindowId\fR, correct \fB\-display\fR, etc.)
@


1.5.2.2
log
@Convert emacs mode comment style to stop problems with old man. [1085127]
@
text
@d1 1
d8 1
a8 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.5.2.1 2004/10/28 10:19:29 dkf Exp $
a79 4

'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.4
log
@	* doc/Tk_Init.3:
	* doc/bell.n:
	* doc/loadTk.n: minor doc cleanup
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.3 1998/09/14 18:22:57 stanton Exp $
d30 2
@


1.3
log
@Replaced SCCS strings, fixed binary files
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id$
d32 1
a32 1
dependent identifier \fIwindowId\fR is used to contain the \fB``.''\fR
d39 1
a39 1
a new toplevel window is created for the \fB``.''\fR window of
d45 1
a45 1
.SH SECURITY ISSUES
@


1.3.18.1
log
@doc cleanup and clarifications from 8.4aCVS backport
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.4 2000/09/07 17:38:16 hobbs Exp $
d32 1
a32 1
dependent identifier \fIwindowId\fR is used to contain the ``.''
d39 1
a39 1
a new toplevel window is created for the ``.'' window of
d45 1
a45 1
.SH "SECURITY ISSUES"
@


1.2
log
@plugin update
@
text
@d7 1
a7 1
'\" SCCS: @@(#) loadTk.n 1.5 97/08/18 17:44:43
@


1.1
log
@Initial revision
@
text
@d16 1
a16 1
\fB::safe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR?
d34 9
a42 3
referencing a window belonging to another application.
Otherwise, a new toplevel window is created for the \fB``.''\fR window of
the safe interpreter.
a49 24
Information in the safe interpreter should never be trusted for security
purposes.
However, because Tk initialization of the safe interpreter do use 
local information, it is unsafe if the safe interpreter 
could have gained control before Tk is loaded.
This will be fixed in an upcoming release, by making Tk initialization in a
safe interpreter use only information found in the interpreter's master
instead of relying on the (un)safe interpreter state.
.PP
You should therefore use \fBsafe::loadTk $slave\fR as soon as possible
after \fBsafe::interpCreate\fR and before any code is evaluated in the safe
interpreter.
The preferred sequence is:
.CS
set slave [::safe::loadTk [::safe::interpCreate]]
.CE
If you want to prevent safe interpreters from loading Tk entirely, you
should create the interpreter as follows:
.CS
::safe::interpCreate \-nostatics \-accesspath \fI{directories...}\fR
.CE
and you must also insure that the virtual access path \fIdirectories\fR for
the interpreter does not contain a dynamically loadable version of Tk.
.PP
d53 10
a62 5
It also sets \fBenv(DISPLAY)\fR in the safe interpreter to the value of
\fBenv(DISPLAY)\fR in the master interpreter, if it exists.
Finally, it sets the slave's Tcl variable \fBargv\fR to \fB\-use\fR 
\fIwindowId\fR in the safe interpreter.

d67 3
@


1.1.4.1
log
@initial tk8.1a2 version
@
text
@d7 1
a7 1
'\" SCCS: @@(#) loadTk.n 1.8 97/11/26 10:10:07
d16 1
a16 1
\fB::safe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? 
d34 3
a36 9
referencing a window belonging to another application. As a convenience,
if the window you plan to use is a Tk Window of the application you
can use the window name (eg: \fB.x.y\fR) instead of its window Id 
(\fB[winfo id .x.y]\fR).
When \fB\-use\fR is not specified,
a new toplevel window is created for the \fB``.''\fR window of
the safe interpreter. On X11 if you want the embedded window
to use another display than the default one, specify it with
\fB\-display\fR.
d44 24
d71 5
a75 10
.PP
.PP
Tk initialization is now safe with respect to not trusting
the slave's state for startup. \fB::safe::loadTk\fR
registers the slave's name so
when the Tk initialization (\fBTk_SafeInit\fR) is called
and in turn calls the master's \fB::safe::InitTk\fR it will
return the desired \fBargv\fR equivalent (\fB\-use\fR 
\fIwindowId\fR, correct \fB\-display\fR, etc...).
.PP
a79 3
.PP
On X11, conflicting \fB\-use\fR and \fB\-display\fR are likely
to generate a fatal X error.
@


1.1.4.2
log
@Merged 8.0.3 changes into 8.1
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: loadTk.n,v 1.3 1998/09/14 18:22:57 stanton Exp $
@


