diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2009-11-10 20:40:06 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2009-11-10 20:40:06 (GMT) |
commit | 1cced1e04ddb24fb248965ccecb3815be9fa44a2 (patch) | |
tree | 36918f8b7ee174ee14a3b7e19580813af8c2fcbe | |
parent | ff59f687d9a7ba1a84e8254166258300183af233 (diff) | |
download | tcl-1cced1e04ddb24fb248965ccecb3815be9fa44a2.zip tcl-1cced1e04ddb24fb248965ccecb3815be9fa44a2.tar.gz tcl-1cced1e04ddb24fb248965ccecb3815be9fa44a2.tar.bz2 |
Cleanup directories that have been set chmod 000.
On Windows7 and Vista we really have no access and these were
getting left behind.
A few tests were changed to reflect the intent of the test where
setting a directory chmod 000 should prevent any
modification. This restriction was ignored on XP but is honoured
on Vista
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | tests/winFCmd.test | 40 |
2 files changed, 40 insertions, 10 deletions
@@ -1,3 +1,13 @@ +2009-11-10 Pat Thoyts <patthoyts@users.sourceforge.net> + + * tests/winFCmd.test: Cleanup directories that have been set chmod + 000. On Windows7 and Vista we really have no access and these were + getting left behind. + A few tests were changed to reflect the intent of the test where + setting a directory chmod 000 should prevent any + modification. This restriction was ignored on XP but is honoured + on Vista + 2009-11-10 Andreas Kupries <andreask@activestate.com> * generic/tclObj.c: Plus memory leak in TclContinuationsEnter(). diff --git a/tests/winFCmd.test b/tests/winFCmd.test index 1199d65..7736985 100644 --- a/tests/winFCmd.test +++ b/tests/winFCmd.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: winFCmd.test,v 1.45 2008/10/06 21:27:05 patthoyts Exp $ +# RCS: @(#) $Id: winFCmd.test,v 1.46 2009/11/10 20:40:06 patthoyts Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -356,6 +356,7 @@ test winFCmd-1.33 {TclpRenameFile: After removing dst dir, MoveFile fails} \ catch {testfile mv c:/tf1 d:/td1} msg list $msg [file writable d:/td1] } -cleanup { + catch {testchmod 666 d:/td1} file delete d:/td1 file delete -force c:/tf1 } -result {EXDEV 0} @@ -523,6 +524,7 @@ test winFCmd-2.12 {TclpCopyFile: CopyFile succeeds} -setup { testfile cp tf1 tf2 list [contents tf2] [file writable tf2] } -cleanup { + catch {testchmod 666 tf1} cleanup } -result {tf1 0} test winFCmd-2.13 {TclpCopyFile: CopyFile fails} -setup { @@ -568,6 +570,7 @@ test winFCmd-2.17 {TclpCopyFile: dst is readonly} -setup { testfile cp tf1 tf2 list [file writable tf2] [contents tf2] } -cleanup { + catch {testchmod 666 tf2} cleanup } -result {1 tf1} test winFCmd-2.18 {TclpCopyFile: still can't copy onto dst} -setup { @@ -656,6 +659,7 @@ test winFCmd-3.11 {TclpDeleteFile: still can't remove path} -setup { testfile rm tf1 } -cleanup { close $fd + catch {testchmod 666 tf1} cleanup } -returnCodes error -result EACCES @@ -697,12 +701,15 @@ test winFCmd-5.1 {TclpCopyDirectory: calls TraverseWinTree} -setup { test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} -setup { cleanup -} -constraints {win testfile testchmod} -body { +} -constraints {winVista testfile testchmod} -body { file mkdir td1 testchmod 000 td1 testfile rmdir td1 file exists td1 -} -result {0} +} -returnCodes error -cleanup { + catch {testchmod 666 td1} + cleanup +} -result {td1 EACCES} # This next test has a very hokey way of matching... test winFCmd-6.2 {TclpRemoveDirectory: errno: EEXIST} -setup { cleanup @@ -748,12 +755,15 @@ test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} -setup { } -result {1 {tf1 ENOTDIR}} test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} -setup { cleanup -} -constraints {win testfile testchmod} -body { +} -constraints {winVista testfile testchmod} -body { file mkdir td1 testchmod 000 td1 testfile rmdir td1 file exists td1 -} -result {0} +} -returnCodes error -cleanup { + catch {testchmod 666 td1} + cleanup +} -result {td1 EACCES} test winFCmd-6.10 {TclpRemoveDirectory: attr == -1} -setup { cleanup } -constraints {win 95 testfile} -body { @@ -778,12 +788,15 @@ test winFCmd-6.12 {TclpRemoveDirectory: errno == EACCES} -setup { } -result {1 {tf1 ENOTDIR}} test winFCmd-6.13 {TclpRemoveDirectory: write-protected} -setup { cleanup -} -constraints {win testfile testchmod} -body { +} -constraints {winVista testfile testchmod} -body { file mkdir td1 testchmod 000 td1 testfile rmdir td1 file exists td1 -} -result {0} +} -cleanup { + catch {testchmod 666 td1} + cleanup +} -returnCodes error -result {td1 EACCES} # This next test has a very hokey way of matching... test winFCmd-6.14 {TclpRemoveDirectory: check if empty dir} -setup { cleanup @@ -896,6 +909,7 @@ test winFCmd-7.11 {TraverseWinTree: call TraversalCopy: DOTREE_PRED} -setup { testfile cpdir td1 td2 list [file exists td2] [file writable td2] } -cleanup { + catch {testchmod 666 td1} cleanup } -result {1 1} test winFCmd-7.12 {TraverseWinTree: call TraversalDelete: DOTREE_PRED} -setup { @@ -931,7 +945,8 @@ test winFCmd-7.15 {TraverseWinTree: append \ to target if necessary} -setup { testfile cpdir td1 / } -cleanup { cleanup -} -returnCodes error -result {/ EACCES} + # Windows7 returns EEXIST, XP returns EACCES +} -returnCodes error -match regexp -result {^/ E(ACCES|EXIST)$} test winFCmd-7.16 {TraverseWinTree: recurse on files: no files} -setup { cleanup } -constraints {win testfile} -body { @@ -973,6 +988,7 @@ test winFCmd-7.19 {TraverseWinTree: call TraversalCopy: DOTREE_POSTD} -setup { testfile cpdir td1 td2 list [file exists td2] [file writable td2] } -cleanup { + catch {testchmod 666 td1} cleanup } -result {1 1} test winFCmd-7.20 {TraverseWinTree: call TraversalDelete: DOTREE_POSTD} -setup { @@ -1003,6 +1019,7 @@ test winFCmd-8.2 {TraversalCopy: DOTREE_PRED} -setup { testfile cpdir td1 td2 list [file writable td1] [file writable td1/td2] } -cleanup { + catch {testchmod 666 td1} cleanup } -result {0 1} test winFCmd-8.3 {TraversalCopy: DOTREE_POSTD} -setup { @@ -1032,12 +1049,15 @@ test winFCmd-9.2 {TraversalDelete: DOTREE_F} -setup { } -returnCodes error -result {td1\tf1 EACCES} test winFCmd-9.3 {TraversalDelete: DOTREE_PRED} -setup { cleanup -} -constraints {win testfile testchmod} -body { +} -constraints {winVista testfile testchmod} -body { file mkdir td1/td2 testchmod 000 td1 testfile rmdir -force td1 file exists td1 -} -result {0} +} -cleanup { + catch {testchmod 666 td1} + cleanup +} -returnCodes error -result {td1 EACCES} test winFCmd-9.4 {TraversalDelete: DOTREE_POSTD} -setup { cleanup } -constraints {win testfile} -body { |