Repository navigation
Conversation
`Win32_Process` returns an empty `ExecutablePath` for processes the account may not read, and `svchost.exe` is one of them. The supervisor lookup filtered the process chain by that path, so the service host stayed a candidate; on a task-scheduled install the `Win32_Service` query then matched the `Schedule` service every task's tree hangs under, and the update refused with `not_controllable` — access denied on the wrong service. Carry the process name (Win32_Process.Name, /proc/<pid>/comm, `ps` comm) and filter the service host by name, keeping the image-path check as the fallback for a listing that has no name. A regression test feeds the rows that a non-admin account actually gets: `svchost.exe` with no executable path. Fixes ompweb-dev#537
Contributor
Contributor
Author
|
Closing as superseded by #539: same diagnosis, same name-based filter, and that version also carries the CHANGELOG entry and a test in the windows-service suite, so it is the better fit for the release flow. For the record, the only extra here was populating |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Win32_Processreturns an emptyExecutablePathfor processes the current account may not read, andsvchost.exeis one of them on a non-admin account.inspectWindowsSupervisorfiltered the process chain by that path, so the service host stayed a candidate; theWin32_Servicequery then matched theScheduleservice every scheduled task's tree hangs under, and the update refused withnot_controllable(access denied on the wrong service).This carries the process name instead and filters by it:
ProcessInfogainsname:Win32_Process.Name,/proc/<pid>/common Linux,ps -o comm=elsewhere.isServiceHostProcess(row)comparesname, falling back to the image path when a listing has none.Why the name and not the path
The path is exactly what is unreadable in the failing case; the name comes from the same listing and is readable, so the filter stops depending on an ACL. It also survives an image being replaced while the process runs.
Verification
Windows 11, the 0.7.3 install shape (a non-admin
omp-web-hostscheduled task runningomp-web.js host), inspecting the live daemon:{"kind":"windows-service","name":"Schedule","configHash":"42a8607f…"}{"kind":"windows-task","path":"\\","name":"omp-web-host","scripts":["…/omp-web-host.ps1"],"configHash":"0beeef23…"}npm run typecheckclean.npm run lintunchanged: 7 pre-existingreact-hooks/exhaustive-depswarnings, 0 errors.bun test --parallel lib/upgrade-process.test.mjs→ 7 pass, 9 skip, 4 fail. The four failures areNew-ScheduledTaskAction/Register-ScheduledTaskaccess-denied on this machine and reproduce identically on a cleanmain(6 pass, 9 skip, 4 fail there) — the new test is the difference.lib/upgrade-process.windows-service.test.mjscovers the task/service paths and needs the elevated CI account it already assumes.The new test feeds the rows a non-admin account actually gets:
Fixes #537
Summary by CodeRabbit