summaryrefslogtreecommitdiffstats
path: root/win/tclWinTest.c
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2018-11-22 14:30:22 (GMT)
committersebres <sebres@users.sourceforge.net>2018-11-22 14:30:22 (GMT)
commit96088693278623a5eb062ad990c45bb1f1e75dab (patch)
tree609e1c954c5310dc52af6a04a27321916a36345b /win/tclWinTest.c
parent5b63da759cd53a00e564e30b49d2296e7baeb568 (diff)
parent1cf15d2b4dfa14df45471804f579f5e4e1cbfae2 (diff)
downloadtcl-96088693278623a5eb062ad990c45bb1f1e75dab.zip
tcl-96088693278623a5eb062ad990c45bb1f1e75dab.tar.gz
tcl-96088693278623a5eb062ad990c45bb1f1e75dab.tar.bz2
merge 8.7
Diffstat (limited to 'win/tclWinTest.c')
-rw-r--r--win/tclWinTest.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index f3e978f..c81ff00 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -399,9 +399,11 @@ TestplatformChmod(
{
static const SECURITY_INFORMATION infoBits = OWNER_SECURITY_INFORMATION
| GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
+ /* don't deny DELETE mask (reset writable only, allow test-cases cleanup) */
static const DWORD readOnlyMask = FILE_DELETE_CHILD | FILE_ADD_FILE
| FILE_ADD_SUBDIRECTORY | FILE_WRITE_EA | FILE_APPEND_DATA
- | FILE_WRITE_DATA | DELETE;
+ | FILE_WRITE_DATA
+ /* | DELETE */;
/*
* References to security functions (only available on NT and later).
@@ -565,11 +567,13 @@ TestplatformChmod(
}
/*
- * Apply the new ACL.
+ * Apply the new ACL. Note PROTECTED_DACL_SECURITY_INFORMATION can be used
+ * to remove inherited ACL (we need to overwrite the default ACL's in this case)
*/
if (set_readOnly == acl_readOnly_found || SetNamedSecurityInfoA(
- (LPSTR) nativePath, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION,
+ (LPSTR) nativePath, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION /*| PROTECTED_DACL_SECURITY_INFORMATION*/,
NULL, NULL, newAcl, NULL) == ERROR_SUCCESS) {
res = 0;
}