Skip to content

Commit 96856e7

Browse files
Stabilize owned Windows fence fixtures before pinning ACLs
1 parent 5f0e005 commit 96856e7

10 files changed

Lines changed: 772 additions & 50 deletions

‎.github/workflows/test.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ jobs:
4646
python -m unittest discover -s tests -p "test_paper_pilot_phase_cutover_guarded_v2_trustees.py" -v 2>&1 | tee "$RUNNER_TEMP/windows-fence-trustees.log"
4747
grep -Eq '^Ran 14 tests in ' "$RUNNER_TEMP/windows-fence-trustees.log"
4848
grep -Eq '^OK[[:space:]]*$' "$RUNNER_TEMP/windows-fence-trustees.log"
49+
- name: Run the twelve owned-fixture ACL stabilization cases (eight contract, four native)
50+
if: always()
51+
shell: bash
52+
run: |
53+
set -o pipefail
54+
python -m unittest discover -s tests -p "test_windows_fixture_acl.py" -v 2>&1 | tee "$RUNNER_TEMP/windows-fixture-acl.log"
55+
grep -Eq '^Ran 12 tests in ' "$RUNNER_TEMP/windows-fixture-acl.log"
56+
grep -Eq '^OK[[:space:]]*$' "$RUNNER_TEMP/windows-fixture-acl.log"
4957
- name: Run the ten strict signed-head DACL fence cases (five contract, five native)
5058
if: always()
5159
shell: bash
@@ -54,13 +62,13 @@ jobs:
5462
python -m unittest discover -s tests -p "test_paper_pilot_phase_cutover_guarded_v2_strict_dacl.py" -v 2>&1 | tee "$RUNNER_TEMP/windows-fence-strict-dacl.log"
5563
grep -Eq '^Ran 10 tests in ' "$RUNNER_TEMP/windows-fence-strict-dacl.log"
5664
grep -Eq '^OK[[:space:]]*$' "$RUNNER_TEMP/windows-fence-strict-dacl.log"
57-
- name: Run the sixteen diagnostics-tool sanitization, trace and cleanup cases
65+
- name: Run the eighteen diagnostics-tool sanitization, trace and cleanup cases
5866
if: always()
5967
shell: bash
6068
run: |
6169
set -o pipefail
6270
python -m unittest discover -s tests -p "test_windows_fence_diagnostics.py" -v 2>&1 | tee "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
63-
grep -Eq '^Ran 16 tests in ' "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
71+
grep -Eq '^Ran 18 tests in ' "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
6472
grep -Eq '^OK[[:space:]]*$' "$RUNNER_TEMP/windows-fence-diagnostics-tests.log"
6573
- name: Sanitized Windows trustee serialization diagnostics
6674
if: always()

‎MANIFEST.json‎

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"hash_algorithm": "SHA-256",
44
"manifest_self_excluded": true,
55
"source_only": true,
6-
"file_count": 707,
6+
"file_count": 709,
77
"files": [
88
{
99
"path": ".github/workflows/test.yml",
10-
"bytes": 3120,
11-
"sha256": "a0b3ff6080fc9e7212219d25ee9432462ea3057902d5cc786156fb7f85f08c90"
10+
"bytes": 3588,
11+
"sha256": "6b5dfbc1cbdf7e6fad4da3f51eec30bef6514a32809701047f61b7d8391fec89"
1212
},
1313
{
1414
"path": ".gitignore",
@@ -2632,23 +2632,23 @@
26322632
},
26332633
{
26342634
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2.py",
2635-
"bytes": 12838,
2636-
"sha256": "a4baf7de9c979aa89ff31c496b9a8e727f94119f823d357e9dfa789ad12cf2f4"
2635+
"bytes": 13300,
2636+
"sha256": "f7c72b60e3e0de9fc2b5dc14056ce88dd27d2db8a82157c07250f088049f30c7"
26372637
},
26382638
{
26392639
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2_simulated_acl.py",
2640-
"bytes": 32224,
2641-
"sha256": "bcb5f16b7052094082fa235b74e3950fab2263f53b777f7c9ea8b7b468beb01f"
2640+
"bytes": 46860,
2641+
"sha256": "eec4d28a522f207bcd28ccf5a1ffcaaaf526144d07c0bd551ef717e9ad6deb72"
26422642
},
26432643
{
26442644
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2_strict_dacl.py",
2645-
"bytes": 16130,
2646-
"sha256": "831a973dbb4a10ee4b593ecf66c08bb57fdf0983c5950742b544db078f278c69"
2645+
"bytes": 18172,
2646+
"sha256": "f714325983bec8b08ced75008a9e4c22cc59b76a0e3524ee720f621f8ca7b154"
26472647
},
26482648
{
26492649
"path": "tests/test_paper_pilot_phase_cutover_guarded_v2_trustees.py",
2650-
"bytes": 18071,
2651-
"sha256": "387a304dd08056ab73feb4e34df7beb34dfaf21d2cfdfdc0c4803c45181adaf9"
2650+
"bytes": 18461,
2651+
"sha256": "13ac20e781fb6580636252871137743a834af56dbe2f031f2208550b94d70611"
26522652
},
26532653
{
26542654
"path": "tests/test_paper_pilot_phase_cutover_guarded_v4.py",
@@ -2957,8 +2957,13 @@
29572957
},
29582958
{
29592959
"path": "tests/test_windows_fence_diagnostics.py",
2960-
"bytes": 17143,
2961-
"sha256": "0157f4e5132d2ad64075b214f7b220b3c2841544f7909d5ae3098bdf23c3d5a7"
2960+
"bytes": 20559,
2961+
"sha256": "c99e5d60eb8deb0bb20f1a5b64d6888f7f7134841ba3016f6991266e9498bab4"
2962+
},
2963+
{
2964+
"path": "tests/test_windows_fixture_acl.py",
2965+
"bytes": 11278,
2966+
"sha256": "704d60ecffa1aa3ad6146d20ad8da719db7ad9b34ad52cc48979323add43a546"
29622967
},
29632968
{
29642969
"path": "tools/build_schemas.py",
@@ -3037,8 +3042,13 @@
30373042
},
30383043
{
30393044
"path": "tools/windows_fence_diagnostics.py",
3040-
"bytes": 19626,
3041-
"sha256": "3b6e5db6ebfa189dd6e4b74b033e6d10dd7fdd552d5002dc306e011252f6b730"
3045+
"bytes": 21532,
3046+
"sha256": "9dabba98d9af2c92b77231e597194204c5a3918c214b319736a2d8ccad371471"
3047+
},
3048+
{
3049+
"path": "tools/windows_fixture_acl.py",
3050+
"bytes": 4355,
3051+
"sha256": "e435337541de6216b0f1634da1a0e36a36915d2897414db80ba5b17cad7272f6"
30423052
},
30433053
{
30443054
"path": "tools/windows_image_ocr.ps1",

‎tests/test_paper_pilot_phase_cutover_guarded_v2.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from src import paper_pilot_phase_cutover_guarded_v2 as guarded
2020
from src.paper_pilot_phase_cutover import _current_sid
21+
from tools import windows_fixture_acl
2122
from trace_gc.budget import RunBudget
2223

2324

@@ -74,6 +75,12 @@ def setUp(self):
7475
(self.old / "budget.sqlite3").read_bytes()).hexdigest()
7576
for name in ("source-stage.lock", "phase-stage.lock"):
7677
(self.root / name).write_bytes(b"0")
78+
# The fixture ACL is made explicit, protected and verified before any pin is taken, so
79+
# nothing depends on what the temporary parent happens to pass down.
80+
windows_fixture_acl.stabilize_owned_fixture(
81+
self.base, [("parent", self.root), ("state", self.old)]
82+
+ [("file:" + name, self.old / name) for name in sorted(guarded.NAMES)],
83+
read=guarded.directory_dacl_sddl)
7784
self.parent_acl_sha = hashlib.sha256(
7885
guarded.directory_dacl_sddl(self.root).encode()).hexdigest()
7986
self.file_acl_sha = {name: hashlib.sha256(

0 commit comments

Comments
 (0)