com php-src: Additional fixs for bug 61746 - prepare/clean acls: ext/standard/tests/file/windows_acls/bug44859.php t
ext/standard/tests/file/windows_acls/bug44859 _2.phpt ext/standard/tests/file/windows_acls/bug4 4859_3.phpt ext/standard/tests/file/windows_a
cls/bug44859_4.phpt ext/standard/tests/file/w indows_acls/common.inc
| From: | Anatoliy Belsky | Date: | Mon, 30 Apr 2012 12:33:48 +0000 |
| Subject: | com php-src: Additional fixs for bug 61746 - prepare/clean acls: ext/standard/tests/file/windows_acls/bug44859.php t ext/standard/tests/file/windows_acls/bug44859 _2.phpt ext/standard/tests/file/windows_acls/bug4 4859_3.phpt ext/standard/tests/file/windows_a cls/bug44859_4.phpt ext/standard/tests/file/w indows_acls/common.inc |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-68896@lists.php.net to get a copy of this message | ||
Commit: ec5421d04403ac3e7b013e65fdd7b3ad6fc82c18
Author: Anatoliy Belsky <ab@php.net> Mon, 30 Apr 2012 14:33:48 +0200
Parents: 680685127fc60fb1891effb7afb33639aa231502
Branches: PHP-5.3 PHP-5.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ec5421d04403ac3e7b013e65fdd7b3ad6fc82c18
Log:
Additional fixs for bug 61746 - prepare/clean acls
Bugs:
https://bugs.php.net/61746
Changed paths:
M ext/standard/tests/file/windows_acls/bug44859.phpt
M ext/standard/tests/file/windows_acls/bug44859_2.phpt
M ext/standard/tests/file/windows_acls/bug44859_3.phpt
M ext/standard/tests/file/windows_acls/bug44859_4.phpt
M ext/standard/tests/file/windows_acls/common..inc
Diff:
diff --git a/ext/standard/tests/file/windows_acls/bug44859.phpt
b/ext/standard/tests/file/windows_acls/bug44859.phpt
index bb22a5c..952b6eb 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 3cc4ed1..d741156 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 7300112..ed57abb 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 c1768d0..954c100 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 4007ad0..26fadf3 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();