-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-15514 EntityTestCase Test failures with Hibernate ORM when run under security manager #5328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…der security manager Signed-off-by: Scott Marlow <smarlow@redhat.com>
1a73c2b
to
6dcb4cb
Compare
The code changes are a result of bringing some changes from ORM 5.3 into ORM 6.1. https://gist.github.com/scottmarlow/28215540cb43ecc31c65f80a01ca8577 shows the ORM 6.1 generated proxy bytecode with this pull request in use. https://gist.github.com/scottmarlow/2c602fcfa8512b904c4c0776a88b8152 shows the ORM 6.1 generated proxy bytecode without this pull request. Some bytecode differences are shown below. Without this pull request, the constructor contained:
Note that the After this pull request is applied, the constructor contains:
|
I looked at the code and it seems to me that you only moved code from static inner class From the bytecode you posted, I understand that the constructor rewriting didn't happen. The only explanation that would make sense is that |
I looked at the code too and may be we are just missing something but as @beikov I was not able to understand how this change can affect the generated code |
I verified locally that testing wildfly with Hibernate ORM 6.1.3.Final sees the failure. I then verified that switching to my local build of Hibernate ORM 6.1.4-SNAPSHOT, the test passes.
https://github.com/hibernate/hibernate-orm/pull/5328/files#diff-0916713f1d03407fd545d95b4d8b75fbf3e5ace094c609837db7958423981e45R249 contains one of the important changes which replaces the application calling java.lang.Class#getMethod directly, to instead call the Hibernate ORM HibernateMethodLookupDispatcher#getDeclaredMethod which is more trusted (by the WildFly Security Manager) than the application code. In order for the application code to be trusted, the application has to include a custom permissions.xml stating that application code can be trusted to
I did single step through the Hibernate ORM proxy generating code a few times and verified that the security manager is installed (it gets setup during WildFly server startup before any applications are deployed). |
Should we add a comment around the |
Superseded by #5334 |
https://hibernate.atlassian.net/browse/HHH-15514
https://issues.redhat.com/browse/WFLY-16974
Signed-off-by: Scott Marlow smarlow@redhat.com