summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-03-18 14:22:50 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-03-18 14:22:50 (GMT)
commite2b19646a5d830ece42abf44cc6237b1f0a456d5 (patch)
treec0df606f4147b4ca2dd7749233b38ea1227986bc
parent3af910c070545d189861d774531870eda3b9c54c (diff)
downloadtcl-e2b19646a5d830ece42abf44cc6237b1f0a456d5.zip
tcl-e2b19646a5d830ece42abf44cc6237b1f0a456d5.tar.gz
tcl-e2b19646a5d830ece42abf44cc6237b1f0a456d5.tar.bz2
[Bug 3608360]: Test to make sure we never let [file exists] do globbing.
-rw-r--r--ChangeLog5
-rw-r--r--tests/cmdAH.test13
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 42d6ed9..83954c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-18 Donal K. Fellows <dkf@users.sf.net>
+
+ * tests/cmdAH.test (cmdAH-19.12): [Bug 3608360]: Added test to ensure
+ that we never ever allow [file exists] to do globbing.
+
2013-03-12 Jan Nijtmans <nijtmans@users.sf.net>
* unix/tcl.m4: Patch by Andrew Shadura, providing better support for
diff --git a/tests/cmdAH.test b/tests/cmdAH.test
index 28e396f..311d3c9 100644
--- a/tests/cmdAH.test
+++ b/tests/cmdAH.test
@@ -909,6 +909,19 @@ test cmdAH-19.11 {Tcl_FileObjCmd: exists} {unixOnly notRoot} {
removeDirectory /tmp/tcl.foo.dir
set result
} 0
+test cmdAH-19.12 {Bug 3608360: [file exists] mustn't do globbing} -setup {
+ set newdirfile [makeDirectory newdir.file]
+ set cwd [pwd]
+ cd $newdirfile
+ # Content of file is totally unimportant; name is *not*
+ set innocentBystander [makeFile "abc" [file join $newdirfile foo.bar]]
+} -body {
+ list [file exists foo.bar] [file exists *.bar]
+} -cleanup {
+ cd $cwd
+ removeFile $innocentBystander
+ removeDirectory $newdirfile
+} -result {1 0}
# Stat related commands