Repository navigation
Commit 0e66671
committed
fix(service): compare a scoped trigger's UserId the same lossy way as the paths
Addresses the CodeRabbit finding on this PR: buildWindowsTaskXml writes the live
Windows account name into <UserId> when it scopes a SessionStateChangeTrigger,
and that value comes back through the same `schtasks /query /xml` code-page
conversion as <Command> and <Arguments>. windowsTaskTriggerScopeAcceptable still
compared it exactly, so an account named outside the console code page failed
the readback for exactly the reason this PR exists — a correctly scoped task read
as unhealthy, and a successful elevated create was rolled back.
The separator rule in taskXmlPathEquals earns its keep on this field rather than
merely carrying over: a placeholder run never matches a backslash, so a
DOMAIN\User scope keeps its domain verified literally. "OTHER\Người" cannot match
a task scoped to "MACHINE\Người", and neither can a deeper "MACHINE\Người\sub".
Two tests: the mangled forms of a non-ASCII account name are accepted, and the
three near-miss accounts above are still rejected alongside an ASCII name that
keeps its exact comparison. Reverting the call site fails one of them.1 parent 912912a commit 0e66671
2 files changed
Lines changed: 49 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2037 | 2037 | | |
2038 | 2038 | | |
2039 | 2039 | | |
2040 | | - | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
2041 | 2048 | | |
2042 | 2049 | | |
2043 | 2050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
586 | 627 | | |
587 | 628 | | |
588 | 629 | | |
| |||
0 commit comments