From: Vince Darley Date: Thu, 8 Nov 2001 19:52:05 +0000 (+0000) Subject: safe interp not allowed X-Git-Tag: vfs-1-2~80 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=5dab749414a6c17349f9596f7468d2d5dea616ab;p=tclvfs safe interp not allowed --- diff --git a/ChangeLog b/ChangeLog index 325097b..523c266 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2001-11-08 Vince Darley - * generic/vfs.c: made code thread-safe. + * generic/vfs.c: made code thread-safe. Disallow + safe interpreters from using vfs code since they can then + mess with the filesystem across all interpreters. 2001-11-07 Vince Darley * generic/vfs.c: all mount information is now stored in a diff --git a/generic/vfs.c b/generic/vfs.c index beb71e1..9c6961c 100644 --- a/generic/vfs.c +++ b/generic/vfs.c @@ -291,6 +291,13 @@ Vfs_Init(interp) if (Tcl_PkgRequire(interp, "Tcl", "8.4", 0) == NULL) { return TCL_ERROR; } + /* + * Safe interpreters are not allowed to modify the filesystem! + * (Since those modifications will affect other interpreters). + */ + if (Tcl_IsSafe(interp)) { + return TCL_ERROR; + } if (Tcl_PkgProvide(interp, "vfs", "1.0") == TCL_ERROR) { return TCL_ERROR; }