mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
On Linux, the previously used ps commands truncate usernames longer than 9 characters and show them as usernam+. This makes attach debugger to process logic to think the process doesn't belong to a user and sudo password is required for attach. We parse command output assuming values in the columns are not wider than the column headers. This assumption doesn't hold on macOS where username longer than 17 characters is not truncated and spills to the next column. As a result we get a wrong command line and a truncated username in UI. The fix is to list process owners using a separate command with the username as the last column. In this case the username is not truncated. The deprecated parseLinuxOutputMacStyle() is changed to throw an exception because there is no way to make it work without process owner command output. There is no internal or external usages of this method. Other possible solutions: On linux it is possible to specify column width in ps (e.g. -o user:32). But this is not supported on macOS. Alternatively, one can specify a custom column header with the desired width (ps -o user:USER_HEADER_NAME), but the header width is fixed. Linux has a 32-characters username limit, but it is not enforced on macOS. (cherry picked from commit 59a08e4a7297f5ecf773964ed678df4f4c1689ec) IJ-CR-155642 (cherry picked from commit e891e8fe4c0f45daa161fdcc524145aec511a3b9) IJ-CR-159806 GitOrigin-RevId: 4abd6b56dff0e92d4c98a5a81f9374f78aa7eb68