summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2024-08-05 13:36:47 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2024-08-05 13:36:47 (GMT)
commit89a59098d13ccddf7453e15b5fb471779b855c35 (patch)
tree6583564e22db742c19262a68fb54a854f7bed68d /tests
parent0f1cf0e7259a56f17647893f0e72b1a7ecd44cf4 (diff)
parentd1cd7b81dcdd271949e29107e30a01fa1c9fb870 (diff)
downloadtcl-89a59098d13ccddf7453e15b5fb471779b855c35.zip
tcl-89a59098d13ccddf7453e15b5fb471779b855c35.tar.gz
tcl-89a59098d13ccddf7453e15b5fb471779b855c35.tar.bz2
Make zipfs inaccessible to safe interps. See bug [a47b587499]
Diffstat (limited to 'tests')
-rw-r--r--tests/interp.test2
-rw-r--r--tests/zipfs.test12
2 files changed, 6 insertions, 8 deletions
diff --git a/tests/interp.test b/tests/interp.test
index 05c987c..dc424dd 100644
--- a/tests/interp.test
+++ b/tests/interp.test
@@ -20,7 +20,7 @@ catch [list package require -exact tcl::test [info patchlevel]]
testConstraint testinterpdelete [llength [info commands testinterpdelete]]
-set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source tcl:encoding:dirs tcl:encoding:system tcl:file:atime tcl:file:attributes tcl:file:copy tcl:file:delete tcl:file:dirname tcl:file:executable tcl:file:exists tcl:file:extension tcl:file:home tcl:file:isdirectory tcl:file:isfile tcl:file:link tcl:file:lstat tcl:file:mkdir tcl:file:mtime tcl:file:nativename tcl:file:normalize tcl:file:owned tcl:file:readable tcl:file:readlink tcl:file:rename tcl:file:rootname tcl:file:size tcl:file:stat tcl:file:tail tcl:file:tempdir tcl:file:tempfile tcl:file:tildeexpand tcl:file:type tcl:file:volumes tcl:file:writable tcl:info:cmdtype tcl:info:nameofexecutable tcl:process:autopurge tcl:process:list tcl:process:purge tcl:process:status tcl:zipfs:lmkimg tcl:zipfs:lmkzip tcl:zipfs:mkimg tcl:zipfs:mkkey tcl:zipfs:mkzip tcl:zipfs:mount tcl:zipfs:mount_data tcl:zipfs:unmount unload}
+set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source tcl:encoding:dirs tcl:encoding:system tcl:file:atime tcl:file:attributes tcl:file:copy tcl:file:delete tcl:file:dirname tcl:file:executable tcl:file:exists tcl:file:extension tcl:file:home tcl:file:isdirectory tcl:file:isfile tcl:file:link tcl:file:lstat tcl:file:mkdir tcl:file:mtime tcl:file:nativename tcl:file:normalize tcl:file:owned tcl:file:readable tcl:file:readlink tcl:file:rename tcl:file:rootname tcl:file:size tcl:file:stat tcl:file:tail tcl:file:tempdir tcl:file:tempfile tcl:file:tildeexpand tcl:file:type tcl:file:volumes tcl:file:writable tcl:info:cmdtype tcl:info:nameofexecutable tcl:process:autopurge tcl:process:list tcl:process:purge tcl:process:status tcl:zipfs:canonical tcl:zipfs:exists tcl:zipfs:info tcl:zipfs:list tcl:zipfs:lmkimg tcl:zipfs:lmkzip tcl:zipfs:mkimg tcl:zipfs:mkkey tcl:zipfs:mkzip tcl:zipfs:mount tcl:zipfs:mount_data tcl:zipfs:root tcl:zipfs:unmount unload zipfs}
proc _ms_limit_args {ms {t0 {}}} {
if {$t0 eq {}} { set t0 [clock milliseconds] }
diff --git a/tests/zipfs.test b/tests/zipfs.test
index 3d583c7..290b3e7 100644
--- a/tests/zipfs.test
+++ b/tests/zipfs.test
@@ -27,9 +27,6 @@ set CWD [pwd]
set tmpdir [file join $CWD tmp]
file mkdir $tmpdir
-test zipfs-0.0 {zipfs basics} -constraints zipfs -body {
- package require tcl::zipfs
-} -result {2.0}
test zipfs-0.1 {zipfs basics} -constraints zipfs -body {
expr {${ziproot} in [file volumes]}
} -result 1
@@ -229,16 +226,17 @@ test zipfs-3.3 {zipfs in child interpreters} -constraints zipfs -setup {
}
} -returnCodes error -cleanup {
interp delete $safe
-} -result {unknown or ambiguous subcommand "?": must be canonical, exists, find, info, list, lmkimg, lmkzip, mkimg, mkkey, mkzip, mount, mount_data, root, or unmount}
-test zipfs-3.4 {zipfs in child interpreters} -constraints zipfs -setup {
+} -result {invalid command name "zipfs"}
+
+test zipfs-3.4 {zipfs in safe interpreters} -constraints zipfs -setup {
set safe [interp create -safe]
} -body {
interp eval $safe {
- zipfs mkzip
+ zipfs
}
} -returnCodes error -cleanup {
interp delete $safe
-} -result {not allowed to invoke subcommand mkzip of zipfs}
+} -result {invalid command name "zipfs"}
test zipfs-4.1 {zipfs lmkimg} -constraints zipfs -setup {
set baseImage [makeFile "return sourceWorking\n\x1A" base]