janhoy opened a new pull request, #4718: URL: https://github.com/apache/solr/pull/4718
## Description On Windows, `SolrProcessManager` (used by the `bin/solr status` CLI) discovers running Solr processes by reading each Java process's command line. Since `ProcessHandle` does not expose command lines on Windows, it previously spawned `powershell.exe` running `Get-CimInstance -ClassName Win32_Process ... | ConvertTo-Json` and parsed the JSON. This PR replaces that with a direct WMI (`Win32_Process`) query via JNA (`jna-platform`), so no external process is spawned and PowerShell no longer needs to be present/enabled. ## Changes - Add `net.java.dev.jna:jna-platform` to `solr-core`. - Rewrite `commandLinesWindows()` to use `CoInitializeEx` → `WmiQuery` → `CoUninitialize`; drop the PowerShell JSON parsing helper and its unit test. - Tighten the test security policy: remove the broad `<<ALL FILES>>` `execute` grant (only needed to exec powershell) and add the JNA native-library load / `jna.*` property-read permissions instead. ## Notes - The WMI code path is Windows-only (`Constants.WINDOWS`); Linux/macOS behaviour is unchanged and all static checks + `SolrProcessManagerTest` pass. The live WMI query has not been exercised on real Windows yet. Draft pending validation on a Windows runner. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
