Skip to content

Commit 94ab502

Browse files
committed
HIVE-29306: GSSException encountered during HMS Ranger authorization
1 parent 742ea4f commit 94ab502

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/security/TUGIAssumingTransport.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public TUGIAssumingTransport(TTransport wrapped, UserGroupInformation ugi) {
4545
@Override
4646
public void open() throws TTransportException {
4747
try {
48-
ugi.doAs(new PrivilegedExceptionAction<Void>() {
48+
UserGroupInformation loggedInUGI = ugi.getRealUser() != null ? ugi.getRealUser() : ugi;
49+
loggedInUGI.doAs(new PrivilegedExceptionAction<Void>() {
4950
public Void run() {
5051
try {
5152
wrapped.open();

0 commit comments

Comments
 (0)