-
Notifications
You must be signed in to change notification settings - Fork 48
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
Patch UGI to work without security manager #45
Conversation
src/main/java/org/apache/hadoop/security/UserGroupInformation.java
Outdated
Show resolved
Hide resolved
I've tested it locally on the Trino build:
|
I think we also need to change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactors lgtm, but which part does make it work without security manager?
This uses the new |
@findepi it doesn't mean that the SecurityManager isn't used because new methods still call the old code but the old methods will be removed in the future and new implementation for new methods will be provided that doesn't use SecurityManager. |
*/ | ||
@InterfaceAudience.Public | ||
@InterfaceStability.Evolving | ||
public <T> T doAs(PrivilegedExceptionAction<T> action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wendigo - this version of UserGroupInformation doesn't include existing public method UserGroupInformation.doAs(PrivilegedAction<T> action)
, which would break any library using this method. Any specific reason to exclude this method? If not, can you please consider adding this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Hadoop shading project is only intended for use by Trino, which doesn't use this method. Can you explain more about your use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We removed the PrivilegedExceptionAction
version of this method as it uses javax.security.auth.Subject#doAs
which is deprecated for removal as of Java 18.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mneethiraj this is an internal Trino fork, that is only used by Trino afaik. We are on JDK 22 and will switch to 23 soon, so this repo contains fixes and changes that are required by the minimum Java version we use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Hadoop shading project is only intended for use by Trino, which doesn't use this method. Can you explain more about your use case?
Yes. a library used in Ranger authorizer for Trino uses UserGroupInformation.doAs(PrivilegedAction<T> action)
while calling Apache Ranger to get policies to authorize accesses in Trino. Move to io.trino.hadoop:apache-hadoop version 3.3.5-3 (from 3.3.5-1) broke the authorizer - due to the missing/remoed method UserGroupInformation.doAs(PrivilegedAction<T> action)
in this version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mneethiraj this is an internal Trino fork, that is only used by Trino afaik. We are on JDK 22 and will switch to 23 soon, so this repo contains fixes and changes that are required by the minimum Java version we use.
@wendigo - is it not possible to retain method UserGroupInformation.doAs(PrivilegedAction<T> action)
while having its implementation updated to work with JDK 23?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not plan to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any compelling reason??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These method are deprecated and will be removed so there is no reason to keep them in the fork
This is a public method in |
@mneethiraj This is Trino fork and it maintains APIs fit for Trino, not Ranger or any other library |
@mneethiraj the solution here is to patch Ranger libraries (and that's what we did in Starburst), not the other way around. Trino project cannot be blocked with using future versions of the JDK because we use some deprecated, to-be-removed APIs. |
@wendigo - thank you for the clarification. This is helpful. |
https://bugs.openjdk.org/browse/JDK-8327134