Re: [External] : Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-24 Thread Sergey Chernyshev
Hi Larry, Thanks for this note! If I understand correctly, "zz" corresponds to the first 10 bits of the encoded UUID attribute of LDAP user record, where all bits are set. Such records have UUIDs that start with -. They are special purposeĀ user accounts, apart from `root`, that have t

Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-19 Thread Sergey Chernyshev
Hi Larry, Thank you for your comments! Yes, it's probably more like base 32 / 5 bits per symbol. The function is actually __user_local_dirname, it's exported by CoreServices (libsystem_coreservices.dylib). One can dlopen() /System/Library/Frameworks/CoreServices.framework/Versions/Current/Cor

Re: [External] : Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-18 Thread Laurence Cable
I believe you can ignore bucket "zz" - Larry On 6/18/25 2:46 PM, Laurence Cable wrote: On 6/18/25 12:44 PM, Sergey Chernyshev wrote: Hi Larry, Thank you for your comments! Yes, it's probably more like base 32 / 5 bits per symbol. The function is actually __user_local_dirname, it's exporte

Re: [External] : Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-18 Thread Laurence Cable
On 6/18/25 12:44 PM, Sergey Chernyshev wrote: Hi Larry, Thank you for your comments! Yes, it's probably more like base 32 / 5 bits per symbol. The function is actually __user_local_dirname, it's exported by CoreServices (libsystem_coreservices.dylib). One can dlopen() /System/Library/Fram

Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-18 Thread Daniel D . Daugherty
On Wed, 18 Jun 2025 16:40:53 GMT, Sergey Chernyshev wrote: >> Hi all, >> >> I would like to propose a fix for JDK-8319589. This will allow jcmd and jps >> running as root to get the complete list of JVMs running by all users, and >> to attach from root to non-root JVMs. Previously, JDK-819738

Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-18 Thread Laurence Cable
I believe that somewhere in the bowels of MacOS libc there is a (hopefully public) function that will map a UID to the UUID used to construct the per-user directory path from a base 36(?) encoded string thereof, the leading 2 characters of which form the "buckets" in /var/folders and the remaind

Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-18 Thread Sergey Chernyshev
On Tue, 17 Jun 2025 04:51:58 GMT, David Holmes wrote: >> Sergey Chernyshev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Update >> src/jdk.attach/macosx/classes/sun/tools/attach/VirtualMachineImpl.java >> >>Co-authored-by: A

Re: RFR: 8319589: Attach from root to a user java process not supported in Mac [v2]

2025-06-18 Thread Sergey Chernyshev
> Hi all, > > I would like to propose a fix for JDK-8319589. This will allow jcmd and jps > running as root to get the complete list of JVMs running by all users, and to > attach from root to non-root JVMs. Previously, JDK-8197387 introduced the > same approach on Linux. > > This change affect