On Tue, 30 Jan 2024 10:47:22 GMT, Sebastian Lövdahl <d...@openjdk.org> wrote:

> 8307977: jcmd and jstack broken for target processes running with elevated 
> capabilities

Marked as reviewed by kevinw (Reviewer).

Hi, looking at it again:
Getting a target's current directory, you have to use /proc/PID/cwd, or you can 
fall back to using tmpdir.
The attach listener uses cwd and then tmpdir, so they will meet either way.

When getting the target's current directory, /proc/PID/cwd will fail for the 
evelated processes, but will work for others (where permissions allow).
So although I suggested the additional change, it can't be that much more 
efficient as it just makes the native attach listener try the second location...

So that was all very interesting, but let me just approve what we have here 
already. No need to proceed with the additional code you had in the comment 
response above.  8-)

-------------

PR Review: https://git.openjdk.org/jdk/pull/17628#pullrequestreview-1872947652
PR Comment: https://git.openjdk.org/jdk/pull/17628#issuecomment-1936379964

Reply via email to