summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Belsky <ab@php.net>2012-04-30 14:33:48 +0200
committerAnatoliy Belsky <ab@php.net>2012-04-30 14:33:48 +0200
commitec5421d04403ac3e7b013e65fdd7b3ad6fc82c18 (patch)
tree8a1bc0c2c224304c49007c7f01c7d81bb97f063f
parent680685127fc60fb1891effb7afb33639aa231502 (diff)
downloadphp-git-ec5421d04403ac3e7b013e65fdd7b3ad6fc82c18.tar.gz
Additional fixs for bug 61746 - prepare/clean acls
-rw-r--r--ext/standard/tests/file/windows_acls/bug44859.phpt1
-rw-r--r--ext/standard/tests/file/windows_acls/bug44859_2.phpt1
-rw-r--r--ext/standard/tests/file/windows_acls/bug44859_3.phpt1
-rw-r--r--ext/standard/tests/file/windows_acls/bug44859_4.phpt1
-rw-r--r--ext/standard/tests/file/windows_acls/common.inc10
5 files changed, 14 insertions, 0 deletions
diff --git a/ext/standard/tests/file/windows_acls/bug44859.phpt b/ext/standard/tests/file/windows_acls/bug44859.phpt
index bb22a5cd8e..952b6eb4c4 100644
--- a/ext/standard/tests/file/windows_acls/bug44859.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859.phpt
@@ -8,6 +8,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
+fix_acls();
$iteration = array(
PHPT_ACL_READ => false,
diff --git a/ext/standard/tests/file/windows_acls/bug44859_2.phpt b/ext/standard/tests/file/windows_acls/bug44859_2.phpt
index 3cc4ed1ba1..d741156baa 100644
--- a/ext/standard/tests/file/windows_acls/bug44859_2.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859_2.phpt
@@ -8,6 +8,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
+fix_acls();
$iteration = array(
PHPT_ACL_READ => true,
diff --git a/ext/standard/tests/file/windows_acls/bug44859_3.phpt b/ext/standard/tests/file/windows_acls/bug44859_3.phpt
index 7300112fc0..ed57abba07 100644
--- a/ext/standard/tests/file/windows_acls/bug44859_3.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859_3.phpt
@@ -8,6 +8,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
+fix_acls();
$iteration = array(
'tiny.exe' => true,
diff --git a/ext/standard/tests/file/windows_acls/bug44859_4.phpt b/ext/standard/tests/file/windows_acls/bug44859_4.phpt
index c1768d02e6..954c1004a5 100644
--- a/ext/standard/tests/file/windows_acls/bug44859_4.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859_4.phpt
@@ -10,6 +10,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
+fix_acls();
$iteration = array(
PHPT_ACL_READ => true,
diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc
index 4007ad009d..26fadf31fc 100644
--- a/ext/standard/tests/file/windows_acls/common.inc
+++ b/ext/standard/tests/file/windows_acls/common.inc
@@ -46,6 +46,16 @@ function get_icacls()
return "$sysroot\\System32\\icacls.exe";
}
+function fix_acls() {
+ $user = get_username();
+ /* Current user needs to be owner of the test files. As well
+ all the other users having acls on the files must loose them.
+ The following fixes this just partially, as dynamically reading
+ all the users having acls on a file could be sophisticated. */
+ exec(get_icacls() . ' . /setowner $user /T /L /Q 2> nul');
+ exec(get_icacls() . ' . /remove:g Administrators /T /L /Q 2> nul');
+}
+
function icacls_set($path, $mode, $perm) {
$icacls = get_icacls();
$user = get_username();