Please review the following fix:

Webrev: http://cr.openjdk.java.net/~sla/7152800/webrev.00/
Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7152800

We sometimes get an error say "well-known file is not secure" when running 
attach-tests on mac osx. The reason is a difference in how files are created 
between linux and mac osx (and that the mac code in HotSpot originates from the 
linux code):

* On linux, the default group owner of a newly created file will be user's 
effective group (id -g).

* On macos, the default group owner of a newly created file will be group owner 
of the directory the file is in.

The attach framework will verify that the file has the same effective owner and 
group as the currently running process. This will be true on linux, since files 
are created with the effective user and group as owner. This will NOT be true 
always on macos, since the file can have a different group if the temporary 
directory has a different group than what we are currently running as.

The fix on macos is to change the group ownership of the well-known file to the 
effective group when the file is created. 

The fix has been verified by manually changing the effective group of the 
launching user.

Thanks,
/Staffan

Reply via email to