Additional fixs for bug 61746 - prepare/clean acls

This commit is contained in:
Anatoliy Belsky 2012-04-30 14:33:48 +02:00
parent 680685127f
commit ec5421d044
5 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
fix_acls();
$iteration = array(
PHPT_ACL_READ => false,

View File

@ -8,6 +8,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
fix_acls();
$iteration = array(
PHPT_ACL_READ => true,

View File

@ -8,6 +8,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
fix_acls();
$iteration = array(
'tiny.exe' => true,

View File

@ -10,6 +10,7 @@ skipif();
--FILE--
<?php
include_once __DIR__ . '/common.inc';
fix_acls();
$iteration = array(
PHPT_ACL_READ => true,

View File

@ -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();